From 7ba512980a89b76f333af34fa55099f2ddab4d13 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Tue, 15 Nov 2022 18:05:46 +0800 Subject: [PATCH] chore: add APACHE-2.0 license header (#518) * feat: add license checker workflow Signed-off-by: Ruihang Xia * fix existing header Signed-off-by: Ruihang Xia * specify license for internal sub-crate Signed-off-by: Ruihang Xia * fix rustfmt Signed-off-by: Ruihang Xia Signed-off-by: Ruihang Xia --- .github/workflows/license.yaml | 16 ++++++++++++++++ .licenserc.yaml | 14 ++++++++++++++ benchmarks/Cargo.toml | 1 + benchmarks/src/bin/nyc-taxi.rs | 14 ++++++++++++++ src/api/Cargo.toml | 1 + src/api/build.rs | 14 ++++++++++++++ src/api/src/error.rs | 14 ++++++++++++++ src/api/src/helper.rs | 14 ++++++++++++++ src/api/src/lib.rs | 14 ++++++++++++++ src/api/src/prometheus.rs | 14 ++++++++++++++ src/api/src/result.rs | 14 ++++++++++++++ src/api/src/serde.rs | 14 ++++++++++++++ src/api/src/v1.rs | 14 ++++++++++++++ src/api/src/v1/meta.rs | 14 ++++++++++++++ src/catalog/Cargo.toml | 1 + src/catalog/src/error.rs | 14 ++++++++++++++ src/catalog/src/lib.rs | 14 ++++++++++++++ src/catalog/src/local.rs | 14 ++++++++++++++ src/catalog/src/local/manager.rs | 14 ++++++++++++++ src/catalog/src/local/memory.rs | 14 ++++++++++++++ src/catalog/src/remote.rs | 14 ++++++++++++++ src/catalog/src/remote/client.rs | 14 ++++++++++++++ src/catalog/src/remote/manager.rs | 14 ++++++++++++++ src/catalog/src/schema.rs | 14 ++++++++++++++ src/catalog/src/system.rs | 14 ++++++++++++++ src/catalog/src/tables.rs | 14 ++++++++++++++ src/catalog/tests/mock.rs | 14 ++++++++++++++ src/catalog/tests/remote_catalog_tests.rs | 14 ++++++++++++++ src/client/Cargo.toml | 1 + src/client/examples/insert.rs | 14 ++++++++++++++ src/client/examples/logical.rs | 14 ++++++++++++++ src/client/examples/physical.rs | 14 ++++++++++++++ src/client/examples/select.rs | 14 ++++++++++++++ src/client/src/admin.rs | 14 ++++++++++++++ src/client/src/client.rs | 14 ++++++++++++++ src/client/src/database.rs | 14 ++++++++++++++ src/client/src/error.rs | 14 ++++++++++++++ src/client/src/lib.rs | 14 ++++++++++++++ src/client/src/load_balance.rs | 14 ++++++++++++++ src/cmd/Cargo.toml | 1 + src/cmd/src/bin/greptime.rs | 14 ++++++++++++++ src/cmd/src/datanode.rs | 14 ++++++++++++++ src/cmd/src/error.rs | 14 ++++++++++++++ src/cmd/src/frontend.rs | 14 ++++++++++++++ src/cmd/src/lib.rs | 14 ++++++++++++++ src/cmd/src/metasrv.rs | 14 ++++++++++++++ src/cmd/src/standalone.rs | 14 ++++++++++++++ src/cmd/src/toml_loader.rs | 14 ++++++++++++++ src/common/base/Cargo.toml | 1 + src/common/base/src/bitset.rs | 14 ++++++++++++++ src/common/base/src/buffer.rs | 14 ++++++++++++++ src/common/base/src/bytes.rs | 14 ++++++++++++++ src/common/base/src/lib.rs | 14 ++++++++++++++ src/common/base/tests/buffer_tests.rs | 14 ++++++++++++++ src/common/catalog/Cargo.toml | 2 +- src/common/catalog/src/consts.rs | 14 ++++++++++++++ src/common/catalog/src/error.rs | 14 ++++++++++++++ src/common/catalog/src/helper.rs | 14 ++++++++++++++ src/common/catalog/src/lib.rs | 14 ++++++++++++++ src/common/error/Cargo.toml | 2 +- src/common/error/src/ext.rs | 14 ++++++++++++++ src/common/error/src/format.rs | 14 ++++++++++++++ src/common/error/src/lib.rs | 14 ++++++++++++++ src/common/error/src/mock.rs | 14 ++++++++++++++ src/common/error/src/status_code.rs | 14 ++++++++++++++ src/common/function-macro/Cargo.toml | 1 + src/common/function-macro/src/lib.rs | 14 ++++++++++++++ src/common/function-macro/tests/test_derive.rs | 14 ++++++++++++++ src/common/function/Cargo.toml | 12 +++++++++++- src/common/function/src/error.rs | 14 ++++++++++++++ src/common/function/src/lib.rs | 14 ++++++++++++++ src/common/function/src/scalars.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/argmax.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/argmin.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/diff.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/mean.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/median.rs | 14 ++++++++++++++ src/common/function/src/scalars/aggregate/mod.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/percentile.rs | 14 ++++++++++++++ .../function/src/scalars/aggregate/polyval.rs | 14 ++++++++++++++ .../scalars/aggregate/scipy_stats_norm_cdf.rs | 14 ++++++++++++++ .../scalars/aggregate/scipy_stats_norm_pdf.rs | 14 ++++++++++++++ .../function/src/scalars/expression/binary.rs | 14 ++++++++++++++ .../function/src/scalars/expression/ctx.rs | 14 ++++++++++++++ .../function/src/scalars/expression/mod.rs | 14 ++++++++++++++ .../function/src/scalars/expression/unary.rs | 14 ++++++++++++++ src/common/function/src/scalars/function.rs | 14 ++++++++++++++ .../function/src/scalars/function_registry.rs | 14 ++++++++++++++ src/common/function/src/scalars/math/mod.rs | 14 ++++++++++++++ src/common/function/src/scalars/math/pow.rs | 14 ++++++++++++++ src/common/function/src/scalars/numpy/clip.rs | 14 ++++++++++++++ src/common/function/src/scalars/numpy/interp.rs | 14 ++++++++++++++ src/common/function/src/scalars/numpy/mod.rs | 14 ++++++++++++++ src/common/function/src/scalars/test.rs | 14 ++++++++++++++ .../src/scalars/timestamp/from_unixtime.rs | 14 ++++++++++++++ src/common/function/src/scalars/timestamp/mod.rs | 14 ++++++++++++++ src/common/function/src/scalars/udf.rs | 14 ++++++++++++++ src/common/grpc/Cargo.toml | 16 ++++++++++++++-- src/common/grpc/benches/bench_main.rs | 14 ++++++++++++++ src/common/grpc/benches/channel_manager.rs | 14 ++++++++++++++ src/common/grpc/src/channel_manager.rs | 14 ++++++++++++++ src/common/grpc/src/error.rs | 14 ++++++++++++++ src/common/grpc/src/lib.rs | 14 ++++++++++++++ src/common/grpc/src/physical.rs | 14 ++++++++++++++ src/common/grpc/src/physical/expr.rs | 14 ++++++++++++++ src/common/grpc/src/physical/plan.rs | 14 ++++++++++++++ src/common/grpc/src/writer.rs | 14 ++++++++++++++ src/common/insert/Cargo.toml | 3 +-- src/common/insert/src/error.rs | 14 ++++++++++++++ src/common/insert/src/insert.rs | 14 ++++++++++++++ src/common/insert/src/lib.rs | 14 ++++++++++++++ src/common/query/Cargo.toml | 5 ++++- src/common/query/src/columnar_value.rs | 14 ++++++++++++++ src/common/query/src/error.rs | 14 ++++++++++++++ src/common/query/src/function.rs | 14 ++++++++++++++ src/common/query/src/lib.rs | 14 ++++++++++++++ src/common/query/src/logical_plan/accumulator.rs | 14 ++++++++++++++ src/common/query/src/logical_plan/expr.rs | 14 ++++++++++++++ src/common/query/src/logical_plan/mod.rs | 14 ++++++++++++++ src/common/query/src/logical_plan/udaf.rs | 14 ++++++++++++++ src/common/query/src/logical_plan/udf.rs | 14 ++++++++++++++ src/common/query/src/physical_plan.rs | 14 ++++++++++++++ src/common/query/src/prelude.rs | 14 ++++++++++++++ src/common/query/src/signature.rs | 14 ++++++++++++++ src/common/recordbatch/Cargo.toml | 5 ++++- src/common/recordbatch/src/adapter.rs | 14 ++++++++++++++ src/common/recordbatch/src/error.rs | 14 ++++++++++++++ src/common/recordbatch/src/lib.rs | 14 ++++++++++++++ src/common/recordbatch/src/recordbatch.rs | 14 ++++++++++++++ src/common/recordbatch/src/util.rs | 14 ++++++++++++++ src/common/runtime/Cargo.toml | 1 + src/common/runtime/src/error.rs | 14 ++++++++++++++ src/common/runtime/src/global.rs | 14 ++++++++++++++ src/common/runtime/src/lib.rs | 14 ++++++++++++++ src/common/runtime/src/metric.rs | 14 ++++++++++++++ src/common/runtime/src/runtime.rs | 14 ++++++++++++++ src/common/substrait/Cargo.toml | 1 + src/common/substrait/src/df_logical.rs | 14 ++++++++++++++ src/common/substrait/src/error.rs | 14 ++++++++++++++ src/common/substrait/src/lib.rs | 14 ++++++++++++++ src/common/substrait/src/schema.rs | 14 ++++++++++++++ src/common/substrait/src/types.rs | 14 ++++++++++++++ src/common/telemetry/Cargo.toml | 13 +++++++++---- src/common/telemetry/src/lib.rs | 14 ++++++++++++++ src/common/telemetry/src/logging.rs | 14 ++++++++++++++ src/common/telemetry/src/macros.rs | 14 ++++++++++++++ src/common/telemetry/src/metric.rs | 14 ++++++++++++++ src/common/telemetry/src/panic_hook.rs | 14 ++++++++++++++ src/common/time/Cargo.toml | 2 +- src/common/time/src/date.rs | 14 ++++++++++++++ src/common/time/src/datetime.rs | 14 ++++++++++++++ src/common/time/src/error.rs | 14 ++++++++++++++ src/common/time/src/lib.rs | 14 ++++++++++++++ src/common/time/src/range.rs | 14 ++++++++++++++ src/common/time/src/timestamp.rs | 14 ++++++++++++++ src/common/time/src/timestamp_millis.rs | 14 ++++++++++++++ src/common/time/src/util.rs | 14 ++++++++++++++ src/datanode/Cargo.toml | 1 + src/datanode/src/datanode.rs | 14 ++++++++++++++ src/datanode/src/error.rs | 14 ++++++++++++++ src/datanode/src/heartbeat.rs | 14 ++++++++++++++ src/datanode/src/instance.rs | 14 ++++++++++++++ src/datanode/src/instance/grpc.rs | 14 ++++++++++++++ src/datanode/src/instance/script.rs | 14 ++++++++++++++ src/datanode/src/instance/sql.rs | 14 ++++++++++++++ src/datanode/src/lib.rs | 14 ++++++++++++++ src/datanode/src/metric.rs | 14 ++++++++++++++ src/datanode/src/mock.rs | 14 ++++++++++++++ src/datanode/src/script.rs | 14 ++++++++++++++ src/datanode/src/server.rs | 14 ++++++++++++++ src/datanode/src/server/grpc.rs | 14 ++++++++++++++ src/datanode/src/server/grpc/ddl.rs | 14 ++++++++++++++ src/datanode/src/server/grpc/plan.rs | 14 ++++++++++++++ src/datanode/src/server/grpc/select.rs | 14 ++++++++++++++ src/datanode/src/sql.rs | 14 ++++++++++++++ src/datanode/src/sql/alter.rs | 14 ++++++++++++++ src/datanode/src/sql/create.rs | 14 ++++++++++++++ src/datanode/src/sql/insert.rs | 14 ++++++++++++++ src/datanode/src/tests.rs | 14 ++++++++++++++ src/datanode/src/tests/grpc_test.rs | 14 ++++++++++++++ src/datanode/src/tests/http_test.rs | 14 ++++++++++++++ src/datanode/src/tests/instance_test.rs | 14 ++++++++++++++ src/datanode/src/tests/test_util.rs | 14 ++++++++++++++ src/datatypes/Cargo.toml | 12 +++++++++++- src/datatypes/src/arrow_array.rs | 14 ++++++++++++++ src/datatypes/src/data_type.rs | 14 ++++++++++++++ src/datatypes/src/deserialize.rs | 1 - src/datatypes/src/error.rs | 14 ++++++++++++++ src/datatypes/src/lib.rs | 15 ++++++++++++++- src/datatypes/src/macros.rs | 14 ++++++++++++++ src/datatypes/src/prelude.rs | 14 ++++++++++++++ src/datatypes/src/scalars.rs | 14 ++++++++++++++ src/datatypes/src/schema.rs | 14 ++++++++++++++ src/datatypes/src/schema/constraint.rs | 14 ++++++++++++++ src/datatypes/src/schema/raw.rs | 14 ++++++++++++++ src/datatypes/src/serialize.rs | 14 ++++++++++++++ src/datatypes/src/type_id.rs | 14 ++++++++++++++ src/datatypes/src/types.rs | 14 ++++++++++++++ src/datatypes/src/types/binary_type.rs | 14 ++++++++++++++ src/datatypes/src/types/boolean_type.rs | 14 ++++++++++++++ src/datatypes/src/types/date.rs | 14 ++++++++++++++ src/datatypes/src/types/datetime.rs | 14 ++++++++++++++ src/datatypes/src/types/list_type.rs | 14 ++++++++++++++ src/datatypes/src/types/null_type.rs | 14 ++++++++++++++ src/datatypes/src/types/primitive_traits.rs | 14 ++++++++++++++ src/datatypes/src/types/primitive_type.rs | 14 ++++++++++++++ src/datatypes/src/types/string_type.rs | 14 ++++++++++++++ src/datatypes/src/types/timestamp.rs | 14 ++++++++++++++ src/datatypes/src/value.rs | 14 ++++++++++++++ src/datatypes/src/vectors.rs | 14 ++++++++++++++ src/datatypes/src/vectors/binary.rs | 14 ++++++++++++++ src/datatypes/src/vectors/boolean.rs | 14 ++++++++++++++ src/datatypes/src/vectors/builder.rs | 14 ++++++++++++++ src/datatypes/src/vectors/constant.rs | 14 ++++++++++++++ src/datatypes/src/vectors/date.rs | 14 ++++++++++++++ src/datatypes/src/vectors/datetime.rs | 14 ++++++++++++++ src/datatypes/src/vectors/eq.rs | 14 ++++++++++++++ src/datatypes/src/vectors/helper.rs | 14 ++++++++++++++ src/datatypes/src/vectors/list.rs | 14 ++++++++++++++ src/datatypes/src/vectors/mutable.rs | 14 ++++++++++++++ src/datatypes/src/vectors/null.rs | 14 ++++++++++++++ src/datatypes/src/vectors/operations.rs | 14 ++++++++++++++ src/datatypes/src/vectors/operations/filter.rs | 14 ++++++++++++++ .../src/vectors/operations/find_unique.rs | 14 ++++++++++++++ .../src/vectors/operations/replicate.rs | 14 ++++++++++++++ src/datatypes/src/vectors/primitive.rs | 14 ++++++++++++++ src/datatypes/src/vectors/string.rs | 14 ++++++++++++++ src/datatypes/src/vectors/timestamp.rs | 14 ++++++++++++++ src/frontend/Cargo.toml | 16 ++++++++++++++-- src/frontend/src/catalog.rs | 14 ++++++++++++++ src/frontend/src/datanode.rs | 14 ++++++++++++++ src/frontend/src/error.rs | 14 ++++++++++++++ src/frontend/src/expr_factory.rs | 14 ++++++++++++++ src/frontend/src/frontend.rs | 14 ++++++++++++++ src/frontend/src/grpc.rs | 14 ++++++++++++++ src/frontend/src/influxdb.rs | 14 ++++++++++++++ src/frontend/src/instance.rs | 14 ++++++++++++++ src/frontend/src/instance/distributed.rs | 14 ++++++++++++++ src/frontend/src/instance/influxdb.rs | 14 ++++++++++++++ src/frontend/src/instance/opentsdb.rs | 14 ++++++++++++++ src/frontend/src/instance/prometheus.rs | 14 ++++++++++++++ src/frontend/src/lib.rs | 14 ++++++++++++++ src/frontend/src/mock.rs | 14 ++++++++++++++ src/frontend/src/mysql.rs | 14 ++++++++++++++ src/frontend/src/opentsdb.rs | 14 ++++++++++++++ src/frontend/src/partitioning.rs | 14 ++++++++++++++ src/frontend/src/partitioning/columns.rs | 14 ++++++++++++++ src/frontend/src/partitioning/range.rs | 14 ++++++++++++++ src/frontend/src/postgres.rs | 14 ++++++++++++++ src/frontend/src/prometheus.rs | 14 ++++++++++++++ src/frontend/src/server.rs | 14 ++++++++++++++ src/frontend/src/spliter.rs | 14 ++++++++++++++ src/frontend/src/sql.rs | 14 ++++++++++++++ src/frontend/src/table.rs | 14 ++++++++++++++ src/frontend/src/table/insert.rs | 14 ++++++++++++++ src/frontend/src/table/route.rs | 14 ++++++++++++++ src/frontend/src/tests.rs | 14 ++++++++++++++ src/log-store/Cargo.toml | 2 +- src/log-store/src/error.rs | 14 ++++++++++++++ src/log-store/src/fs.rs | 14 ++++++++++++++ src/log-store/src/fs/chunk.rs | 14 ++++++++++++++ src/log-store/src/fs/config.rs | 14 ++++++++++++++ src/log-store/src/fs/crc.rs | 14 ++++++++++++++ src/log-store/src/fs/entry.rs | 14 ++++++++++++++ src/log-store/src/fs/file.rs | 14 ++++++++++++++ src/log-store/src/fs/file_name.rs | 14 ++++++++++++++ src/log-store/src/fs/index.rs | 14 ++++++++++++++ src/log-store/src/fs/io.rs | 14 ++++++++++++++ src/log-store/src/fs/io/fallback.rs | 14 ++++++++++++++ src/log-store/src/fs/io/unix.rs | 14 ++++++++++++++ src/log-store/src/fs/log.rs | 14 ++++++++++++++ src/log-store/src/fs/namespace.rs | 14 ++++++++++++++ src/log-store/src/fs/noop.rs | 14 ++++++++++++++ src/log-store/src/lib.rs | 14 ++++++++++++++ src/log-store/src/test_util.rs | 14 ++++++++++++++ src/log-store/src/test_util/log_store_util.rs | 14 ++++++++++++++ src/meta-client/Cargo.toml | 1 + src/meta-client/examples/meta_client.rs | 14 ++++++++++++++ src/meta-client/src/client.rs | 14 ++++++++++++++ src/meta-client/src/client/heartbeat.rs | 14 ++++++++++++++ src/meta-client/src/client/load_balance.rs | 14 ++++++++++++++ src/meta-client/src/client/router.rs | 14 ++++++++++++++ src/meta-client/src/client/store.rs | 14 ++++++++++++++ src/meta-client/src/error.rs | 14 ++++++++++++++ src/meta-client/src/lib.rs | 14 ++++++++++++++ src/meta-client/src/mocks.rs | 14 ++++++++++++++ src/meta-client/src/rpc.rs | 14 ++++++++++++++ src/meta-client/src/rpc/router.rs | 14 ++++++++++++++ src/meta-client/src/rpc/store.rs | 14 ++++++++++++++ src/meta-client/src/rpc/util.rs | 14 ++++++++++++++ src/meta-srv/Cargo.toml | 1 + src/meta-srv/examples/kv_store.rs | 14 ++++++++++++++ src/meta-srv/src/bootstrap.rs | 14 ++++++++++++++ src/meta-srv/src/election.rs | 14 ++++++++++++++ src/meta-srv/src/election/etcd.rs | 14 ++++++++++++++ src/meta-srv/src/error.rs | 14 ++++++++++++++ src/meta-srv/src/handler.rs | 14 ++++++++++++++ src/meta-srv/src/handler/check_leader.rs | 14 ++++++++++++++ src/meta-srv/src/handler/datanode_lease.rs | 14 ++++++++++++++ src/meta-srv/src/handler/response_header.rs | 14 ++++++++++++++ src/meta-srv/src/keys.rs | 14 ++++++++++++++ src/meta-srv/src/lease.rs | 14 ++++++++++++++ src/meta-srv/src/lib.rs | 14 ++++++++++++++ src/meta-srv/src/metasrv.rs | 14 ++++++++++++++ src/meta-srv/src/mocks.rs | 14 ++++++++++++++ src/meta-srv/src/selector.rs | 14 ++++++++++++++ src/meta-srv/src/selector/lease_based.rs | 14 ++++++++++++++ src/meta-srv/src/sequence.rs | 14 ++++++++++++++ src/meta-srv/src/service.rs | 14 ++++++++++++++ src/meta-srv/src/service/admin.rs | 14 ++++++++++++++ src/meta-srv/src/service/admin/health.rs | 14 ++++++++++++++ src/meta-srv/src/service/heartbeat.rs | 14 ++++++++++++++ src/meta-srv/src/service/router.rs | 14 ++++++++++++++ src/meta-srv/src/service/store.rs | 14 ++++++++++++++ src/meta-srv/src/service/store/etcd.rs | 14 ++++++++++++++ src/meta-srv/src/service/store/kv.rs | 14 ++++++++++++++ src/meta-srv/src/service/store/memory.rs | 14 ++++++++++++++ src/meta-srv/src/util.rs | 14 ++++++++++++++ src/object-store/Cargo.toml | 2 +- src/object-store/src/backend.rs | 14 ++++++++++++++ src/object-store/src/backend/azblob.rs | 14 ++++++++++++++ src/object-store/src/backend/fs.rs | 14 ++++++++++++++ src/object-store/src/backend/memory.rs | 14 ++++++++++++++ src/object-store/src/backend/s3.rs | 14 ++++++++++++++ src/object-store/src/lib.rs | 14 ++++++++++++++ src/object-store/src/util.rs | 14 ++++++++++++++ src/object-store/tests/object_store_test.rs | 14 ++++++++++++++ src/query/Cargo.toml | 1 + src/query/src/database.rs | 1 - src/query/src/datafusion.rs | 14 ++++++++++++++ src/query/src/datafusion/catalog_adapter.rs | 14 ++++++++++++++ src/query/src/datafusion/error.rs | 14 ++++++++++++++ src/query/src/datafusion/planner.rs | 14 ++++++++++++++ src/query/src/error.rs | 14 ++++++++++++++ src/query/src/executor.rs | 14 ++++++++++++++ src/query/src/expr.rs | 14 ++++++++++++++ src/query/src/function.rs | 14 ++++++++++++++ src/query/src/lib.rs | 15 ++++++++++++++- src/query/src/logical_optimizer.rs | 14 ++++++++++++++ src/query/src/metric.rs | 14 ++++++++++++++ src/query/src/optimizer.rs | 14 ++++++++++++++ src/query/src/physical_optimizer.rs | 14 ++++++++++++++ src/query/src/physical_planner.rs | 14 ++++++++++++++ src/query/src/plan.rs | 14 ++++++++++++++ src/query/src/planner.rs | 14 ++++++++++++++ src/query/src/query_engine.rs | 14 ++++++++++++++ src/query/src/query_engine/context.rs | 14 ++++++++++++++ src/query/src/query_engine/state.rs | 14 ++++++++++++++ src/query/src/sql.rs | 14 ++++++++++++++ src/query/tests/argmax_test.rs | 14 ++++++++++++++ src/query/tests/argmin_test.rs | 14 ++++++++++++++ src/query/tests/function.rs | 14 ++++++++++++++ src/query/tests/mean_test.rs | 14 ++++++++++++++ src/query/tests/my_sum_udaf_example.rs | 14 ++++++++++++++ src/query/tests/percentile_test.rs | 14 ++++++++++++++ src/query/tests/polyval_test.rs | 14 ++++++++++++++ src/query/tests/pow.rs | 14 ++++++++++++++ src/query/tests/query_engine_test.rs | 14 ++++++++++++++ src/query/tests/scipy_stats_norm_cdf_test.rs | 14 ++++++++++++++ src/query/tests/scipy_stats_norm_pdf.rs | 14 ++++++++++++++ src/script/Cargo.toml | 8 ++++++-- src/script/src/engine.rs | 14 ++++++++++++++ src/script/src/error.rs | 14 ++++++++++++++ src/script/src/lib.rs | 14 ++++++++++++++ src/script/src/manager.rs | 14 ++++++++++++++ src/script/src/python.rs | 14 ++++++++++++++ src/script/src/python/builtins/mod.rs | 14 ++++++++++++++ src/script/src/python/builtins/test.rs | 14 ++++++++++++++ src/script/src/python/coprocessor.rs | 14 ++++++++++++++ src/script/src/python/coprocessor/compile.rs | 14 ++++++++++++++ src/script/src/python/coprocessor/parse.rs | 14 ++++++++++++++ src/script/src/python/engine.rs | 14 ++++++++++++++ src/script/src/python/error.rs | 14 ++++++++++++++ src/script/src/python/test.rs | 14 ++++++++++++++ src/script/src/python/utils.rs | 14 ++++++++++++++ src/script/src/python/vector.rs | 14 ++++++++++++++ src/script/src/table.rs | 14 ++++++++++++++ src/servers/Cargo.toml | 1 + src/servers/src/context.rs | 14 ++++++++++++++ src/servers/src/error.rs | 14 ++++++++++++++ src/servers/src/grpc.rs | 14 ++++++++++++++ src/servers/src/grpc/handler.rs | 14 ++++++++++++++ src/servers/src/http.rs | 14 ++++++++++++++ src/servers/src/http/context.rs | 14 ++++++++++++++ src/servers/src/http/handler.rs | 14 ++++++++++++++ src/servers/src/http/influxdb.rs | 14 ++++++++++++++ src/servers/src/http/opentsdb.rs | 14 ++++++++++++++ src/servers/src/http/prometheus.rs | 14 ++++++++++++++ src/servers/src/http/script.rs | 14 ++++++++++++++ src/servers/src/influxdb.rs | 14 ++++++++++++++ src/servers/src/lib.rs | 14 ++++++++++++++ src/servers/src/line_writer.rs | 14 ++++++++++++++ src/servers/src/mysql/federated.rs | 14 ++++++++++++++ src/servers/src/mysql/handler.rs | 14 ++++++++++++++ src/servers/src/mysql/mod.rs | 14 ++++++++++++++ src/servers/src/mysql/server.rs | 14 ++++++++++++++ src/servers/src/mysql/writer.rs | 14 ++++++++++++++ src/servers/src/opentsdb.rs | 14 ++++++++++++++ src/servers/src/opentsdb/codec.rs | 14 ++++++++++++++ src/servers/src/opentsdb/connection.rs | 14 ++++++++++++++ src/servers/src/opentsdb/handler.rs | 14 ++++++++++++++ src/servers/src/postgres/auth_handler.rs | 14 ++++++++++++++ src/servers/src/postgres/handler.rs | 14 ++++++++++++++ src/servers/src/postgres/mod.rs | 14 ++++++++++++++ src/servers/src/postgres/server.rs | 14 ++++++++++++++ src/servers/src/prometheus.rs | 14 ++++++++++++++ src/servers/src/query_handler.rs | 14 ++++++++++++++ src/servers/src/server.rs | 14 ++++++++++++++ src/servers/src/shutdown.rs | 14 ++++++++++++++ src/servers/tests/http/http_handler_test.rs | 14 ++++++++++++++ src/servers/tests/http/influxdb_test.rs | 14 ++++++++++++++ src/servers/tests/http/mod.rs | 14 ++++++++++++++ src/servers/tests/http/opentsdb_test.rs | 14 ++++++++++++++ src/servers/tests/http/prometheus_test.rs | 14 ++++++++++++++ src/servers/tests/mod.rs | 14 ++++++++++++++ src/servers/tests/mysql/mod.rs | 14 ++++++++++++++ src/servers/tests/mysql/mysql_server_test.rs | 14 ++++++++++++++ src/servers/tests/mysql/mysql_writer_test.rs | 14 ++++++++++++++ src/servers/tests/opentsdb.rs | 14 ++++++++++++++ src/servers/tests/postgres/mod.rs | 14 ++++++++++++++ src/sql/Cargo.toml | 2 +- src/sql/src/ast.rs | 14 ++++++++++++++ src/sql/src/dialect.rs | 14 ++++++++++++++ src/sql/src/error.rs | 14 ++++++++++++++ src/sql/src/lib.rs | 14 ++++++++++++++ src/sql/src/parser.rs | 14 ++++++++++++++ src/sql/src/parsers.rs | 14 ++++++++++++++ src/sql/src/parsers/alter_parser.rs | 14 ++++++++++++++ src/sql/src/parsers/create_parser.rs | 14 ++++++++++++++ src/sql/src/parsers/insert_parser.rs | 14 ++++++++++++++ src/sql/src/parsers/query_parser.rs | 14 ++++++++++++++ src/sql/src/statements.rs | 14 ++++++++++++++ src/sql/src/statements/alter.rs | 14 ++++++++++++++ src/sql/src/statements/create.rs | 14 ++++++++++++++ src/sql/src/statements/insert.rs | 14 ++++++++++++++ src/sql/src/statements/query.rs | 14 ++++++++++++++ src/sql/src/statements/show.rs | 14 ++++++++++++++ src/sql/src/statements/statement.rs | 14 ++++++++++++++ src/sql/src/statements/statement_query.rs | 14 ++++++++++++++ src/storage/Cargo.toml | 2 +- src/storage/benches/bench_main.rs | 14 ++++++++++++++ .../benches/memtable/bench_memtable_read.rs | 14 ++++++++++++++ .../memtable/bench_memtable_read_write_ratio.rs | 14 ++++++++++++++ .../benches/memtable/bench_memtable_write.rs | 14 ++++++++++++++ src/storage/benches/memtable/mod.rs | 14 ++++++++++++++ .../benches/memtable/util/bench_context.rs | 14 ++++++++++++++ src/storage/benches/memtable/util/mod.rs | 14 ++++++++++++++ .../benches/memtable/util/regiondesc_util.rs | 14 ++++++++++++++ src/storage/benches/memtable/util/schema_util.rs | 14 ++++++++++++++ src/storage/benches/wal/bench_decode.rs | 14 ++++++++++++++ src/storage/benches/wal/bench_encode.rs | 14 ++++++++++++++ src/storage/benches/wal/bench_wal.rs | 14 ++++++++++++++ src/storage/benches/wal/mod.rs | 14 ++++++++++++++ src/storage/benches/wal/util/mod.rs | 14 ++++++++++++++ src/storage/benches/wal/util/write_batch_util.rs | 14 ++++++++++++++ src/storage/build.rs | 14 ++++++++++++++ src/storage/src/background.rs | 14 ++++++++++++++ src/storage/src/chunk.rs | 14 ++++++++++++++ src/storage/src/codec.rs | 14 ++++++++++++++ src/storage/src/config.rs | 14 ++++++++++++++ src/storage/src/engine.rs | 14 ++++++++++++++ src/storage/src/error.rs | 14 ++++++++++++++ src/storage/src/flush.rs | 14 ++++++++++++++ src/storage/src/lib.rs | 14 ++++++++++++++ src/storage/src/manifest.rs | 15 ++++++++++++++- src/storage/src/manifest/action.rs | 14 ++++++++++++++ src/storage/src/manifest/checkpoint.rs | 1 - src/storage/src/manifest/helper.rs | 14 ++++++++++++++ src/storage/src/manifest/impl_.rs | 14 ++++++++++++++ src/storage/src/manifest/region.rs | 14 ++++++++++++++ src/storage/src/manifest/storage.rs | 14 ++++++++++++++ src/storage/src/manifest/test_utils.rs | 14 ++++++++++++++ src/storage/src/memtable.rs | 14 ++++++++++++++ src/storage/src/memtable/btree.rs | 14 ++++++++++++++ src/storage/src/memtable/inserter.rs | 14 ++++++++++++++ src/storage/src/memtable/tests.rs | 14 ++++++++++++++ src/storage/src/memtable/version.rs | 14 ++++++++++++++ src/storage/src/metadata.rs | 14 ++++++++++++++ src/storage/src/proto.rs | 14 ++++++++++++++ src/storage/src/proto/wal.rs | 14 ++++++++++++++ src/storage/src/proto/write_batch.rs | 14 ++++++++++++++ src/storage/src/read.rs | 14 ++++++++++++++ src/storage/src/read/dedup.rs | 14 ++++++++++++++ src/storage/src/read/merge.rs | 14 ++++++++++++++ src/storage/src/region.rs | 14 ++++++++++++++ src/storage/src/region/tests.rs | 14 ++++++++++++++ src/storage/src/region/tests/alter.rs | 14 ++++++++++++++ src/storage/src/region/tests/basic.rs | 14 ++++++++++++++ src/storage/src/region/tests/flush.rs | 14 ++++++++++++++ src/storage/src/region/tests/projection.rs | 14 ++++++++++++++ src/storage/src/region/writer.rs | 14 ++++++++++++++ src/storage/src/schema.rs | 14 ++++++++++++++ src/storage/src/schema/compat.rs | 14 ++++++++++++++ src/storage/src/schema/projected.rs | 14 ++++++++++++++ src/storage/src/schema/region.rs | 14 ++++++++++++++ src/storage/src/schema/store.rs | 14 ++++++++++++++ src/storage/src/snapshot.rs | 14 ++++++++++++++ src/storage/src/sst.rs | 14 ++++++++++++++ src/storage/src/sst/parquet.rs | 14 ++++++++++++++ src/storage/src/sync.rs | 14 ++++++++++++++ src/storage/src/test_util.rs | 14 ++++++++++++++ src/storage/src/test_util/config_util.rs | 14 ++++++++++++++ src/storage/src/test_util/descriptor_util.rs | 14 ++++++++++++++ src/storage/src/test_util/read_util.rs | 14 ++++++++++++++ src/storage/src/test_util/schema_util.rs | 14 ++++++++++++++ src/storage/src/test_util/write_batch_util.rs | 14 ++++++++++++++ src/storage/src/version.rs | 14 ++++++++++++++ src/storage/src/wal.rs | 14 ++++++++++++++ src/storage/src/write_batch.rs | 14 ++++++++++++++ src/storage/src/write_batch/compat.rs | 14 ++++++++++++++ src/store-api/Cargo.toml | 2 +- src/store-api/src/lib.rs | 14 ++++++++++++++ src/store-api/src/logstore.rs | 14 ++++++++++++++ src/store-api/src/logstore/entry.rs | 14 ++++++++++++++ src/store-api/src/logstore/entry_stream.rs | 14 ++++++++++++++ src/store-api/src/logstore/namespace.rs | 14 ++++++++++++++ src/store-api/src/manifest.rs | 14 ++++++++++++++ src/store-api/src/manifest/action.rs | 14 ++++++++++++++ src/store-api/src/manifest/storage.rs | 14 ++++++++++++++ src/store-api/src/storage.rs | 14 ++++++++++++++ src/store-api/src/storage/chunk.rs | 14 ++++++++++++++ src/store-api/src/storage/consts.rs | 14 ++++++++++++++ src/store-api/src/storage/descriptors.rs | 14 ++++++++++++++ src/store-api/src/storage/engine.rs | 14 ++++++++++++++ src/store-api/src/storage/metadata.rs | 14 ++++++++++++++ src/store-api/src/storage/region.rs | 14 ++++++++++++++ src/store-api/src/storage/requests.rs | 14 ++++++++++++++ src/store-api/src/storage/responses.rs | 14 ++++++++++++++ src/store-api/src/storage/snapshot.rs | 14 ++++++++++++++ src/store-api/src/storage/types.rs | 14 ++++++++++++++ src/table-engine/Cargo.toml | 5 ++++- src/table-engine/src/config.rs | 14 ++++++++++++++ src/table-engine/src/engine.rs | 14 ++++++++++++++ src/table-engine/src/error.rs | 14 ++++++++++++++ src/table-engine/src/lib.rs | 14 ++++++++++++++ src/table-engine/src/manifest.rs | 14 ++++++++++++++ src/table-engine/src/manifest/action.rs | 14 ++++++++++++++ src/table-engine/src/table.rs | 14 ++++++++++++++ src/table-engine/src/table/test_util.rs | 14 ++++++++++++++ .../src/table/test_util/mock_engine.rs | 14 ++++++++++++++ src/table/Cargo.toml | 1 + src/table/src/engine.rs | 14 ++++++++++++++ src/table/src/error.rs | 14 ++++++++++++++ src/table/src/lib.rs | 14 ++++++++++++++ src/table/src/metadata.rs | 14 ++++++++++++++ src/table/src/predicate.rs | 14 ++++++++++++++ src/table/src/predicate/stats.rs | 14 ++++++++++++++ src/table/src/requests.rs | 14 ++++++++++++++ src/table/src/table.rs | 14 ++++++++++++++ src/table/src/table/adapter.rs | 14 ++++++++++++++ src/table/src/table/numbers.rs | 14 ++++++++++++++ src/table/src/table/scan.rs | 14 ++++++++++++++ src/table/src/test_util.rs | 14 ++++++++++++++ src/table/src/test_util/empty_table.rs | 14 ++++++++++++++ src/table/src/test_util/memtable.rs | 14 ++++++++++++++ src/table/src/test_util/mock_engine.rs | 14 ++++++++++++++ 556 files changed, 7383 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/license.yaml create mode 100644 .licenserc.yaml delete mode 100644 src/datatypes/src/deserialize.rs delete mode 100644 src/query/src/database.rs delete mode 100644 src/storage/src/manifest/checkpoint.rs diff --git a/.github/workflows/license.yaml b/.github/workflows/license.yaml new file mode 100644 index 0000000000..488757cc80 --- /dev/null +++ b/.github/workflows/license.yaml @@ -0,0 +1,16 @@ +name: License checker + +on: + push: + branches: + - develop + pull_request: + types: [opened, synchronize, reopened, ready_for_review] +jobs: + license-header-check: + runs-on: ubuntu-latest + name: license-header-check + steps: + - uses: actions/checkout@v2 + - name: Check License Header + uses: apache/skywalking-eyes/header@main diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000000..dfcb6df2c7 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,14 @@ +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Greptime Team + + paths: + - "**/*.rs" + - "**/*.py" + + comment: on-failure + +dependency: + files: + - Cargo.toml diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 6d6cb9bd93..2d2819178e 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -2,6 +2,7 @@ name = "benchmarks" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] arrow = "10" diff --git a/benchmarks/src/bin/nyc-taxi.rs b/benchmarks/src/bin/nyc-taxi.rs index caac625ef4..fe434591f3 100644 --- a/benchmarks/src/bin/nyc-taxi.rs +++ b/benchmarks/src/bin/nyc-taxi.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Use the taxi trip records from New York City dataset to bench. You can download the dataset from //! [here](https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page). diff --git a/src/api/Cargo.toml b/src/api/Cargo.toml index e9e07bf522..035ba7d7c5 100644 --- a/src/api/Cargo.toml +++ b/src/api/Cargo.toml @@ -2,6 +2,7 @@ name = "api" version = "0.1.0" edition = "2021" +license = "Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/api/build.rs b/src/api/build.rs index 4f398f2d71..ec88ccf408 100644 --- a/src/api/build.rs +++ b/src/api/build.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::path::PathBuf; fn main() { diff --git a/src/api/src/error.rs b/src/api/src/error.rs index 6fc0eaf141..2320e199d7 100644 --- a/src/api/src/error.rs +++ b/src/api/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::ErrorExt; diff --git a/src/api/src/helper.rs b/src/api/src/helper.rs index 7958eb2c1e..cdcf704c8d 100644 --- a/src/api/src/helper.rs +++ b/src/api/src/helper.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_base::BitVec; use common_time::timestamp::TimeUnit; use datatypes::prelude::ConcreteDataType; diff --git a/src/api/src/lib.rs b/src/api/src/lib.rs index ae2c2912fb..d6c415d8cf 100644 --- a/src/api/src/lib.rs +++ b/src/api/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod error; pub mod helper; pub mod prometheus; diff --git a/src/api/src/prometheus.rs b/src/api/src/prometheus.rs index 31e109b909..1ce8940a88 100644 --- a/src/api/src/prometheus.rs +++ b/src/api/src/prometheus.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(clippy::derive_partial_eq_without_eq)] pub mod remote { diff --git a/src/api/src/result.rs b/src/api/src/result.rs index 725ccce68c..ca656b0905 100644 --- a/src/api/src/result.rs +++ b/src/api/src/result.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_error::prelude::ErrorExt; use crate::v1::codec::SelectResult; diff --git a/src/api/src/serde.rs b/src/api/src/serde.rs index d485c7cef8..9daf64e8e6 100644 --- a/src/api/src/serde.rs +++ b/src/api/src/serde.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use prost::DecodeError; use prost::Message; diff --git a/src/api/src/v1.rs b/src/api/src/v1.rs index 588d28140a..4438ce7870 100644 --- a/src/api/src/v1.rs +++ b/src/api/src/v1.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(clippy::derive_partial_eq_without_eq)] tonic::include_proto!("greptime.v1"); diff --git a/src/api/src/v1/meta.rs b/src/api/src/v1/meta.rs index fd74246a4d..2959e08d68 100644 --- a/src/api/src/v1/meta.rs +++ b/src/api/src/v1/meta.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + tonic::include_proto!("greptime.v1.meta"); use std::collections::HashMap; diff --git a/src/catalog/Cargo.toml b/src/catalog/Cargo.toml index ef7eeb46c8..aa9f38f774 100644 --- a/src/catalog/Cargo.toml +++ b/src/catalog/Cargo.toml @@ -2,6 +2,7 @@ name = "catalog" version = "0.1.0" edition = "2021" +license = "Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/catalog/src/error.rs b/src/catalog/src/error.rs index fb9a14284d..a389597394 100644 --- a/src/catalog/src/error.rs +++ b/src/catalog/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::{BoxedError, ErrorExt}; diff --git a/src/catalog/src/lib.rs b/src/catalog/src/lib.rs index 1ddce7d308..941d2c2580 100644 --- a/src/catalog/src/lib.rs +++ b/src/catalog/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] use std::any::Any; diff --git a/src/catalog/src/local.rs b/src/catalog/src/local.rs index 33cda37275..42c24c152e 100644 --- a/src/catalog/src/local.rs +++ b/src/catalog/src/local.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod manager; pub mod memory; diff --git a/src/catalog/src/local/manager.rs b/src/catalog/src/local/manager.rs index f2f09d81aa..89fc62b6b9 100644 --- a/src/catalog/src/local/manager.rs +++ b/src/catalog/src/local/manager.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::Arc; diff --git a/src/catalog/src/local/memory.rs b/src/catalog/src/local/memory.rs index 65cd03506b..a32b29e204 100644 --- a/src/catalog/src/local/memory.rs +++ b/src/catalog/src/local/memory.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::collections::hash_map::Entry; use std::collections::HashMap; diff --git a/src/catalog/src/remote.rs b/src/catalog/src/remote.rs index c2d525ff12..36a382b736 100644 --- a/src/catalog/src/remote.rs +++ b/src/catalog/src/remote.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::Debug; use std::pin::Pin; use std::sync::Arc; diff --git a/src/catalog/src/remote/client.rs b/src/catalog/src/remote/client.rs index b072add0bc..ad41ef6f2e 100644 --- a/src/catalog/src/remote/client.rs +++ b/src/catalog/src/remote/client.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::Debug; use std::sync::Arc; diff --git a/src/catalog/src/remote/manager.rs b/src/catalog/src/remote/manager.rs index 7d0ce17ec5..5fd814ec1c 100644 --- a/src/catalog/src/remote/manager.rs +++ b/src/catalog/src/remote/manager.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::collections::HashMap; use std::pin::Pin; diff --git a/src/catalog/src/schema.rs b/src/catalog/src/schema.rs index 739c9cc835..eae813d2f2 100644 --- a/src/catalog/src/schema.rs +++ b/src/catalog/src/schema.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/catalog/src/system.rs b/src/catalog/src/system.rs index 3175d9b0a7..887c4a8022 100644 --- a/src/catalog/src/system.rs +++ b/src/catalog/src/system.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::collections::HashMap; use std::sync::Arc; diff --git a/src/catalog/src/tables.rs b/src/catalog/src/tables.rs index 321d086ffd..3379943af6 100644 --- a/src/catalog/src/tables.rs +++ b/src/catalog/src/tables.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // The `tables` table in system catalog keeps a record of all tables created by user. use std::any::Any; diff --git a/src/catalog/tests/mock.rs b/src/catalog/tests/mock.rs index cc9f67c7d4..067abc7ca0 100644 --- a/src/catalog/tests/mock.rs +++ b/src/catalog/tests/mock.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::btree_map::Entry; use std::collections::{BTreeMap, HashMap}; use std::fmt::{Display, Formatter}; diff --git a/src/catalog/tests/remote_catalog_tests.rs b/src/catalog/tests/remote_catalog_tests.rs index 0f86475d00..b43fd09889 100644 --- a/src/catalog/tests/remote_catalog_tests.rs +++ b/src/catalog/tests/remote_catalog_tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] mod mock; diff --git a/src/client/Cargo.toml b/src/client/Cargo.toml index 6706bfd203..826cebe35c 100644 --- a/src/client/Cargo.toml +++ b/src/client/Cargo.toml @@ -2,6 +2,7 @@ name = "client" version = "0.1.0" edition = "2021" +license = "Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/client/examples/insert.rs b/src/client/examples/insert.rs index 9e813e3759..fa31d0c01e 100644 --- a/src/client/examples/insert.rs +++ b/src/client/examples/insert.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::codec::InsertBatch; diff --git a/src/client/examples/logical.rs b/src/client/examples/logical.rs index cd105ded5a..9e00269f2f 100644 --- a/src/client/examples/logical.rs +++ b/src/client/examples/logical.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::{ColumnDataType, ColumnDef, CreateExpr}; use client::admin::Admin; use client::{Client, Database}; diff --git a/src/client/examples/physical.rs b/src/client/examples/physical.rs index a6263487dc..4f60fc7c43 100644 --- a/src/client/examples/physical.rs +++ b/src/client/examples/physical.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use client::{Client, Database}; diff --git a/src/client/examples/select.rs b/src/client/examples/select.rs index 160c217fc5..01516e732a 100644 --- a/src/client/examples/select.rs +++ b/src/client/examples/select.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use client::{Client, Database, Select}; use tracing::{event, Level}; diff --git a/src/client/src/admin.rs b/src/client/src/admin.rs index d0784058a0..d872dd41d2 100644 --- a/src/client/src/admin.rs +++ b/src/client/src/admin.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::*; use common_error::prelude::StatusCode; use common_query::Output; diff --git a/src/client/src/client.rs b/src/client/src/client.rs index a43334bb45..5b4af8e96b 100644 --- a/src/client/src/client.rs +++ b/src/client/src/client.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::greptime_client::GreptimeClient; diff --git a/src/client/src/database.rs b/src/client/src/database.rs index d8c4fc913c..689edfe145 100644 --- a/src/client/src/database.rs +++ b/src/client/src/database.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::codec::SelectResult as GrpcSelectResult; diff --git a/src/client/src/error.rs b/src/client/src/error.rs index 042949f60a..add1a0989e 100644 --- a/src/client/src/error.rs +++ b/src/client/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/client/src/lib.rs b/src/client/src/lib.rs index 3ce630a301..931f45c802 100644 --- a/src/client/src/lib.rs +++ b/src/client/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod admin; mod client; mod database; diff --git a/src/client/src/load_balance.rs b/src/client/src/load_balance.rs index 60e37a4e1b..90b2fae339 100644 --- a/src/client/src/load_balance.rs +++ b/src/client/src/load_balance.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use enum_dispatch::enum_dispatch; use rand::seq::SliceRandom; diff --git a/src/cmd/Cargo.toml b/src/cmd/Cargo.toml index 6da004f169..30d2c504db 100644 --- a/src/cmd/Cargo.toml +++ b/src/cmd/Cargo.toml @@ -3,6 +3,7 @@ name = "cmd" version = "0.1.0" edition = "2021" default-run = "greptime" +license = "Apache-2.0" [[bin]] name = "greptime" diff --git a/src/cmd/src/bin/greptime.rs b/src/cmd/src/bin/greptime.rs index b173af1d83..4beb4b805d 100644 --- a/src/cmd/src/bin/greptime.rs +++ b/src/cmd/src/bin/greptime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use clap::Parser; diff --git a/src/cmd/src/datanode.rs b/src/cmd/src/datanode.rs index 639899a8aa..c08d41539a 100644 --- a/src/cmd/src/datanode.rs +++ b/src/cmd/src/datanode.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use clap::Parser; use common_telemetry::logging; use datanode::datanode::{Datanode, DatanodeOptions}; diff --git a/src/cmd/src/error.rs b/src/cmd/src/error.rs index 866783a8f5..cedc7ba19c 100644 --- a/src/cmd/src/error.rs +++ b/src/cmd/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs index b20e3c0e80..416a772c61 100644 --- a/src/cmd/src/frontend.rs +++ b/src/cmd/src/frontend.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use clap::Parser; use frontend::frontend::{Frontend, FrontendOptions, Mode}; use frontend::grpc::GrpcOptions; diff --git a/src/cmd/src/lib.rs b/src/cmd/src/lib.rs index ee7ee01d6e..8b5dc10641 100644 --- a/src/cmd/src/lib.rs +++ b/src/cmd/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] pub mod datanode; diff --git a/src/cmd/src/metasrv.rs b/src/cmd/src/metasrv.rs index 9c9f3b62b5..a6cb988cc1 100644 --- a/src/cmd/src/metasrv.rs +++ b/src/cmd/src/metasrv.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use clap::Parser; use common_telemetry::logging; use meta_srv::bootstrap; diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index 432af68ce2..60c6fae6fe 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use clap::Parser; use common_telemetry::info; use datanode::datanode::{Datanode, DatanodeOptions, ObjectStoreConfig}; diff --git a/src/cmd/src/toml_loader.rs b/src/cmd/src/toml_loader.rs index da87816e13..8eb1b080b9 100644 --- a/src/cmd/src/toml_loader.rs +++ b/src/cmd/src/toml_loader.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + macro_rules! from_file { ($path: expr) => { toml::from_str( diff --git a/src/common/base/Cargo.toml b/src/common/base/Cargo.toml index 0ecd8e2629..c1718a2ae0 100644 --- a/src/common/base/Cargo.toml +++ b/src/common/base/Cargo.toml @@ -2,6 +2,7 @@ name = "common-base" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] bitvec = "1.0" diff --git a/src/common/base/src/bitset.rs b/src/common/base/src/bitset.rs index dd3529a81b..3244e749e7 100644 --- a/src/common/base/src/bitset.rs +++ b/src/common/base/src/bitset.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use bitvec::prelude as bv; // `Lsb0` provides the best codegen for bit manipulation, diff --git a/src/common/base/src/buffer.rs b/src/common/base/src/buffer.rs index c50bfcaaf5..26303c6f88 100644 --- a/src/common/base/src/buffer.rs +++ b/src/common/base/src/buffer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::io::{Read, Write}; diff --git a/src/common/base/src/bytes.rs b/src/common/base/src/bytes.rs index 2fde5f5f95..9f5cff5dd9 100644 --- a/src/common/base/src/bytes.rs +++ b/src/common/base/src/bytes.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::ops::Deref; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/src/common/base/src/lib.rs b/src/common/base/src/lib.rs index d31fb9e30f..2e58f5d826 100644 --- a/src/common/base/src/lib.rs +++ b/src/common/base/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod bitset; pub mod buffer; pub mod bytes; diff --git a/src/common/base/tests/buffer_tests.rs b/src/common/base/tests/buffer_tests.rs index 958f6312cb..76d577618a 100644 --- a/src/common/base/tests/buffer_tests.rs +++ b/src/common/base/tests/buffer_tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] #[cfg(test)] diff --git a/src/common/catalog/Cargo.toml b/src/common/catalog/Cargo.toml index 1623bf6038..5df337479c 100644 --- a/src/common/catalog/Cargo.toml +++ b/src/common/catalog/Cargo.toml @@ -2,7 +2,7 @@ name = "common-catalog" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] async-trait = "0.1" diff --git a/src/common/catalog/src/consts.rs b/src/common/catalog/src/consts.rs index 5bd94a75fc..775cddcb42 100644 --- a/src/common/catalog/src/consts.rs +++ b/src/common/catalog/src/consts.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub const SYSTEM_CATALOG_NAME: &str = "system"; pub const INFORMATION_SCHEMA_NAME: &str = "information_schema"; pub const SYSTEM_CATALOG_TABLE_NAME: &str = "system_catalog"; diff --git a/src/common/catalog/src/error.rs b/src/common/catalog/src/error.rs index 0ce3a49f69..0a4613b89b 100644 --- a/src/common/catalog/src/error.rs +++ b/src/common/catalog/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::ErrorExt; diff --git a/src/common/catalog/src/helper.rs b/src/common/catalog/src/helper.rs index 91598c0104..e36778c946 100644 --- a/src/common/catalog/src/helper.rs +++ b/src/common/catalog/src/helper.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::fmt::{Display, Formatter}; diff --git a/src/common/catalog/src/lib.rs b/src/common/catalog/src/lib.rs index eb016c2dd0..30e01900b3 100644 --- a/src/common/catalog/src/lib.rs +++ b/src/common/catalog/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod consts; pub mod error; mod helper; diff --git a/src/common/error/Cargo.toml b/src/common/error/Cargo.toml index d03de11f55..0e52c2d098 100644 --- a/src/common/error/Cargo.toml +++ b/src/common/error/Cargo.toml @@ -2,7 +2,7 @@ name = "common-error" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] snafu = { version = "0.7", features = ["backtraces"] } diff --git a/src/common/error/src/ext.rs b/src/common/error/src/ext.rs index 934b5b4ea3..54b4343120 100644 --- a/src/common/error/src/ext.rs +++ b/src/common/error/src/ext.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use crate::status_code::StatusCode; diff --git a/src/common/error/src/format.rs b/src/common/error/src/format.rs index 74e3c6bd5d..4113621cb0 100644 --- a/src/common/error/src/format.rs +++ b/src/common/error/src/format.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use crate::ext::ErrorExt; diff --git a/src/common/error/src/lib.rs b/src/common/error/src/lib.rs index f65f8190a5..0b8542137a 100644 --- a/src/common/error/src/lib.rs +++ b/src/common/error/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod ext; pub mod format; pub mod mock; diff --git a/src/common/error/src/mock.rs b/src/common/error/src/mock.rs index a1b23dcbcc..e3165aefe0 100644 --- a/src/common/error/src/mock.rs +++ b/src/common/error/src/mock.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Utils for mock. use std::any::Any; diff --git a/src/common/error/src/status_code.rs b/src/common/error/src/status_code.rs index 299c8fd1bc..1489de6e60 100644 --- a/src/common/error/src/status_code.rs +++ b/src/common/error/src/status_code.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; /// Common status code for public API. diff --git a/src/common/function-macro/Cargo.toml b/src/common/function-macro/Cargo.toml index 51749b388c..35ebd78347 100644 --- a/src/common/function-macro/Cargo.toml +++ b/src/common/function-macro/Cargo.toml @@ -2,6 +2,7 @@ name = "common-function-macro" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] proc-macro = true diff --git a/src/common/function-macro/src/lib.rs b/src/common/function-macro/src/lib.rs index 5d95d346b3..da254c3c16 100644 --- a/src/common/function-macro/src/lib.rs +++ b/src/common/function-macro/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::parse::Parser; diff --git a/src/common/function-macro/tests/test_derive.rs b/src/common/function-macro/tests/test_derive.rs index 08c57c2403..fb4e9bf1db 100644 --- a/src/common/function-macro/tests/test_derive.rs +++ b/src/common/function-macro/tests/test_derive.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_function_macro::{as_aggr_func_creator, AggrFuncTypeStore}; use static_assertions::{assert_fields, assert_impl_all}; diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index b5f118dfbd..214fa0ade9 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -2,6 +2,7 @@ edition = "2021" name = "common-function" version = "0.1.0" +license = "Apache-2.0" [dependencies] arc-swap = "1.0" @@ -21,7 +22,16 @@ snafu = { version = "0.7", features = ["backtraces"] } statrs = "0.15" [dependencies.arrow] -features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "ahash", "compute", "serde_types"] +features = [ + "io_csv", + "io_json", + "io_parquet", + "io_parquet_compression", + "io_ipc", + "ahash", + "compute", + "serde_types", +] package = "arrow2" version = "0.10" diff --git a/src/common/function/src/error.rs b/src/common/function/src/error.rs index c184f6c2fa..73c3928a00 100644 --- a/src/common/function/src/error.rs +++ b/src/common/function/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/common/function/src/lib.rs b/src/common/function/src/lib.rs index b7bfa04e41..5a1b8edacb 100644 --- a/src/common/function/src/lib.rs +++ b/src/common/function/src/lib.rs @@ -1,2 +1,16 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod error; pub mod scalars; diff --git a/src/common/function/src/scalars.rs b/src/common/function/src/scalars.rs index f59ed52db6..d362ea5f89 100644 --- a/src/common/function/src/scalars.rs +++ b/src/common/function/src/scalars.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod aggregate; pub mod expression; pub mod function; diff --git a/src/common/function/src/scalars/aggregate/argmax.rs b/src/common/function/src/scalars/aggregate/argmax.rs index dd5e2d275f..0b63a766bd 100644 --- a/src/common/function/src/scalars/aggregate/argmax.rs +++ b/src/common/function/src/scalars/aggregate/argmax.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/argmin.rs b/src/common/function/src/scalars/aggregate/argmin.rs index 61ccecc3cc..bcbd6571c5 100644 --- a/src/common/function/src/scalars/aggregate/argmin.rs +++ b/src/common/function/src/scalars/aggregate/argmin.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/diff.rs b/src/common/function/src/scalars/aggregate/diff.rs index 7fb10a01ce..d0e7ca3406 100644 --- a/src/common/function/src/scalars/aggregate/diff.rs +++ b/src/common/function/src/scalars/aggregate/diff.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::marker::PhantomData; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/mean.rs b/src/common/function/src/scalars/aggregate/mean.rs index 4f37a49d4e..2393a58cd2 100644 --- a/src/common/function/src/scalars/aggregate/mean.rs +++ b/src/common/function/src/scalars/aggregate/mean.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::marker::PhantomData; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/median.rs b/src/common/function/src/scalars/aggregate/median.rs index 7cd3601a5c..4c445c0fb9 100644 --- a/src/common/function/src/scalars/aggregate/median.rs +++ b/src/common/function/src/scalars/aggregate/median.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Reverse; use std::collections::BinaryHeap; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/mod.rs b/src/common/function/src/scalars/aggregate/mod.rs index 06dbf36561..8a4712a1b8 100644 --- a/src/common/function/src/scalars/aggregate/mod.rs +++ b/src/common/function/src/scalars/aggregate/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod argmax; mod argmin; mod diff; diff --git a/src/common/function/src/scalars/aggregate/percentile.rs b/src/common/function/src/scalars/aggregate/percentile.rs index fbf497edcc..1b642dd274 100644 --- a/src/common/function/src/scalars/aggregate/percentile.rs +++ b/src/common/function/src/scalars/aggregate/percentile.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Reverse; use std::collections::BinaryHeap; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/polyval.rs b/src/common/function/src/scalars/aggregate/polyval.rs index aa9f2e35eb..75a9d809f7 100644 --- a/src/common/function/src/scalars/aggregate/polyval.rs +++ b/src/common/function/src/scalars/aggregate/polyval.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::marker::PhantomData; use std::sync::Arc; diff --git a/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs b/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs index 4346b1b004..8f43b64e92 100644 --- a/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs +++ b/src/common/function/src/scalars/aggregate/scipy_stats_norm_cdf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_function_macro::{as_aggr_func_creator, AggrFuncTypeStore}; diff --git a/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs b/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs index b38b90d0dd..e381d11b54 100644 --- a/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs +++ b/src/common/function/src/scalars/aggregate/scipy_stats_norm_pdf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_function_macro::{as_aggr_func_creator, AggrFuncTypeStore}; diff --git a/src/common/function/src/scalars/expression/binary.rs b/src/common/function/src/scalars/expression/binary.rs index f0eea0ec2d..b02e46c937 100644 --- a/src/common/function/src/scalars/expression/binary.rs +++ b/src/common/function/src/scalars/expression/binary.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::iter; use datatypes::prelude::*; diff --git a/src/common/function/src/scalars/expression/ctx.rs b/src/common/function/src/scalars/expression/ctx.rs index 87f7e5afea..7910bb82b8 100644 --- a/src/common/function/src/scalars/expression/ctx.rs +++ b/src/common/function/src/scalars/expression/ctx.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use chrono_tz::Tz; use crate::error::Error; diff --git a/src/common/function/src/scalars/expression/mod.rs b/src/common/function/src/scalars/expression/mod.rs index 6fe84c189c..a66b0d04e5 100644 --- a/src/common/function/src/scalars/expression/mod.rs +++ b/src/common/function/src/scalars/expression/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod binary; mod ctx; mod unary; diff --git a/src/common/function/src/scalars/expression/unary.rs b/src/common/function/src/scalars/expression/unary.rs index 848b4edcd1..a3434a2b0e 100644 --- a/src/common/function/src/scalars/expression/unary.rs +++ b/src/common/function/src/scalars/expression/unary.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::prelude::*; use snafu::ResultExt; diff --git a/src/common/function/src/scalars/function.rs b/src/common/function/src/scalars/function.rs index 751803eff3..353f524ea9 100644 --- a/src/common/function/src/scalars/function.rs +++ b/src/common/function/src/scalars/function.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use std::sync::Arc; diff --git a/src/common/function/src/scalars/function_registry.rs b/src/common/function/src/scalars/function_registry.rs index a3c9d5d4a3..ff8dc2338b 100644 --- a/src/common/function/src/scalars/function_registry.rs +++ b/src/common/function/src/scalars/function_registry.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! functions registry use std::collections::HashMap; use std::sync::{Arc, RwLock}; diff --git a/src/common/function/src/scalars/math/mod.rs b/src/common/function/src/scalars/math/mod.rs index bd9f60b855..db3d4a51bf 100644 --- a/src/common/function/src/scalars/math/mod.rs +++ b/src/common/function/src/scalars/math/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod pow; use std::sync::Arc; diff --git a/src/common/function/src/scalars/math/pow.rs b/src/common/function/src/scalars/math/pow.rs index 0df3739004..fcbb877240 100644 --- a/src/common/function/src/scalars/math/pow.rs +++ b/src/common/function/src/scalars/math/pow.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use std::sync::Arc; diff --git a/src/common/function/src/scalars/numpy/clip.rs b/src/common/function/src/scalars/numpy/clip.rs index 63455c0831..f743bf5ff5 100644 --- a/src/common/function/src/scalars/numpy/clip.rs +++ b/src/common/function/src/scalars/numpy/clip.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use std::sync::Arc; diff --git a/src/common/function/src/scalars/numpy/interp.rs b/src/common/function/src/scalars/numpy/interp.rs index cacd072915..f2c3b28bb3 100644 --- a/src/common/function/src/scalars/numpy/interp.rs +++ b/src/common/function/src/scalars/numpy/interp.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::array::PrimitiveArray; diff --git a/src/common/function/src/scalars/numpy/mod.rs b/src/common/function/src/scalars/numpy/mod.rs index 2c648b73b8..76140fb7de 100644 --- a/src/common/function/src/scalars/numpy/mod.rs +++ b/src/common/function/src/scalars/numpy/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod clip; #[allow(unused)] mod interp; diff --git a/src/common/function/src/scalars/test.rs b/src/common/function/src/scalars/test.rs index fb0dfeb519..7d74ff5d83 100644 --- a/src/common/function/src/scalars/test.rs +++ b/src/common/function/src/scalars/test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use std::sync::Arc; diff --git a/src/common/function/src/scalars/timestamp/from_unixtime.rs b/src/common/function/src/scalars/timestamp/from_unixtime.rs index b3a5472de1..f480547436 100644 --- a/src/common/function/src/scalars/timestamp/from_unixtime.rs +++ b/src/common/function/src/scalars/timestamp/from_unixtime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! from_unixtime function. /// TODO(dennis) It can be removed after we upgrade datafusion. use std::fmt; diff --git a/src/common/function/src/scalars/timestamp/mod.rs b/src/common/function/src/scalars/timestamp/mod.rs index 5648b31389..f326aec283 100644 --- a/src/common/function/src/scalars/timestamp/mod.rs +++ b/src/common/function/src/scalars/timestamp/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod from_unixtime; diff --git a/src/common/function/src/scalars/udf.rs b/src/common/function/src/scalars/udf.rs index cef806a985..b2d47af34d 100644 --- a/src/common/function/src/scalars/udf.rs +++ b/src/common/function/src/scalars/udf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_query::error::{ExecuteFunctionSnafu, FromScalarValueSnafu}; diff --git a/src/common/grpc/Cargo.toml b/src/common/grpc/Cargo.toml index e72abc1996..0e1c8283d4 100644 --- a/src/common/grpc/Cargo.toml +++ b/src/common/grpc/Cargo.toml @@ -2,6 +2,7 @@ name = "common-grpc" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] api = { path = "../../api" } @@ -10,7 +11,9 @@ common-base = { path = "../base" } common-error = { path = "../error" } common-runtime = { path = "../runtime" } dashmap = "5.4" -datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = ["simd"] } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [ + "simd", +] } snafu = { version = "0.7", features = ["backtraces"] } tokio = { version = "1.0", features = ["full"] } tonic = "0.8" @@ -19,7 +22,16 @@ tower = "0.4" [dependencies.arrow] package = "arrow2" version = "0.10" -features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "ahash", "compute", "serde_types"] +features = [ + "io_csv", + "io_json", + "io_parquet", + "io_parquet_compression", + "io_ipc", + "ahash", + "compute", + "serde_types", +] [dev-dependencies] criterion = "0.4" diff --git a/src/common/grpc/benches/bench_main.rs b/src/common/grpc/benches/bench_main.rs index b1e7a22bf2..3d29e5ee2e 100644 --- a/src/common/grpc/benches/bench_main.rs +++ b/src/common/grpc/benches/bench_main.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::criterion_main; mod channel_manager; diff --git a/src/common/grpc/benches/channel_manager.rs b/src/common/grpc/benches/channel_manager.rs index c9aa17bd86..0b95dcddd0 100644 --- a/src/common/grpc/benches/channel_manager.rs +++ b/src/common/grpc/benches/channel_manager.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_grpc::channel_manager::ChannelManager; use criterion::{criterion_group, criterion_main, Criterion}; diff --git a/src/common/grpc/src/channel_manager.rs b/src/common/grpc/src/channel_manager.rs index ffb45b10ee..7bb87872f8 100644 --- a/src/common/grpc/src/channel_manager.rs +++ b/src/common/grpc/src/channel_manager.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::time::Duration; diff --git a/src/common/grpc/src/error.rs b/src/common/grpc/src/error.rs index eb62ac7f2a..9ec77d7355 100644 --- a/src/common/grpc/src/error.rs +++ b/src/common/grpc/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use api::DecodeError; diff --git a/src/common/grpc/src/lib.rs b/src/common/grpc/src/lib.rs index 62a2f53ecd..f489a9ee93 100644 --- a/src/common/grpc/src/lib.rs +++ b/src/common/grpc/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod channel_manager; pub mod error; pub mod physical; diff --git a/src/common/grpc/src/physical.rs b/src/common/grpc/src/physical.rs index fc3c6a0061..13778a8634 100644 --- a/src/common/grpc/src/physical.rs +++ b/src/common/grpc/src/physical.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod expr; pub mod plan; diff --git a/src/common/grpc/src/physical/expr.rs b/src/common/grpc/src/physical/expr.rs index e6dfe70681..f0186d192e 100644 --- a/src/common/grpc/src/physical/expr.rs +++ b/src/common/grpc/src/physical/expr.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::result::Result; use std::sync::Arc; diff --git a/src/common/grpc/src/physical/plan.rs b/src/common/grpc/src/physical/plan.rs index 885c7237d6..44a8d79ec6 100644 --- a/src/common/grpc/src/physical/plan.rs +++ b/src/common/grpc/src/physical/plan.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::ops::Deref; use std::result::Result; use std::sync::Arc; diff --git a/src/common/grpc/src/writer.rs b/src/common/grpc/src/writer.rs index 364c9a0182..42e27fc887 100644 --- a/src/common/grpc/src/writer.rs +++ b/src/common/grpc/src/writer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::codec::InsertBatch; diff --git a/src/common/insert/Cargo.toml b/src/common/insert/Cargo.toml index b6d28c3680..8dca21eb9a 100644 --- a/src/common/insert/Cargo.toml +++ b/src/common/insert/Cargo.toml @@ -2,8 +2,7 @@ name = "common-insert" version = "0.1.0" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] api = { path = "../../api" } diff --git a/src/common/insert/src/error.rs b/src/common/insert/src/error.rs index d06568ff14..dbd455b2ec 100644 --- a/src/common/insert/src/error.rs +++ b/src/common/insert/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use api::DecodeError; diff --git a/src/common/insert/src/insert.rs b/src/common/insert/src/insert.rs index 173d9121e0..4f597d3d37 100644 --- a/src/common/insert/src/insert.rs +++ b/src/common/insert/src/insert.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::hash_map::Entry; use std::collections::{HashMap, HashSet}; use std::ops::Deref; diff --git a/src/common/insert/src/lib.rs b/src/common/insert/src/lib.rs index eea4a6837b..3bac3e0969 100644 --- a/src/common/insert/src/lib.rs +++ b/src/common/insert/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod error; mod insert; pub use insert::{ diff --git a/src/common/query/Cargo.toml b/src/common/query/Cargo.toml index 93031856a1..a5bf8960f5 100644 --- a/src/common/query/Cargo.toml +++ b/src/common/query/Cargo.toml @@ -2,13 +2,16 @@ name = "common-query" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] async-trait = "0.1" common-error = { path = "../error" } common-recordbatch = { path = "../recordbatch" } common-time = { path = "../time" } -datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = ["simd"] } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [ + "simd", +] } datafusion-common = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } datafusion-expr = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } datatypes = { path = "../../datatypes" } diff --git a/src/common/query/src/columnar_value.rs b/src/common/query/src/columnar_value.rs index 2e645979c4..849b8b24b7 100644 --- a/src/common/query/src/columnar_value.rs +++ b/src/common/query/src/columnar_value.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datafusion_expr::ColumnarValue as DfColumnarValue; use datatypes::prelude::ConcreteDataType; use datatypes::vectors::{Helper, VectorRef}; diff --git a/src/common/query/src/error.rs b/src/common/query/src/error.rs index 1e29da234c..e90df0c300 100644 --- a/src/common/query/src/error.rs +++ b/src/common/query/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use arrow::datatypes::DataType as ArrowDatatype; diff --git a/src/common/query/src/function.rs b/src/common/query/src/function.rs index bcb4170aff..635dc20cd9 100644 --- a/src/common/query/src/function.rs +++ b/src/common/query/src/function.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/common/query/src/lib.rs b/src/common/query/src/lib.rs index 19bb5b8f1b..06b88fcbf8 100644 --- a/src/common/query/src/lib.rs +++ b/src/common/query/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_recordbatch::{RecordBatches, SendableRecordBatchStream}; pub mod columnar_value; diff --git a/src/common/query/src/logical_plan/accumulator.rs b/src/common/query/src/logical_plan/accumulator.rs index 4247b61c97..379a582dc1 100644 --- a/src/common/query/src/logical_plan/accumulator.rs +++ b/src/common/query/src/logical_plan/accumulator.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Accumulator module contains the trait definition for aggregation function's accumulators. use std::fmt::Debug; diff --git a/src/common/query/src/logical_plan/expr.rs b/src/common/query/src/logical_plan/expr.rs index bfebbaa9c2..45cb12cdeb 100644 --- a/src/common/query/src/logical_plan/expr.rs +++ b/src/common/query/src/logical_plan/expr.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datafusion::logical_plan::Expr as DfExpr; /// Central struct of query API. diff --git a/src/common/query/src/logical_plan/mod.rs b/src/common/query/src/logical_plan/mod.rs index 36777ce0c3..89b0e95ccd 100644 --- a/src/common/query/src/logical_plan/mod.rs +++ b/src/common/query/src/logical_plan/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod accumulator; mod expr; mod udaf; diff --git a/src/common/query/src/logical_plan/udaf.rs b/src/common/query/src/logical_plan/udaf.rs index 9761fb470a..9550946ef9 100644 --- a/src/common/query/src/logical_plan/udaf.rs +++ b/src/common/query/src/logical_plan/udaf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Udaf module contains functions and structs supporting user-defined aggregate functions. //! //! Modified from DataFusion. diff --git a/src/common/query/src/logical_plan/udf.rs b/src/common/query/src/logical_plan/udf.rs index dbd0926243..b16fb50254 100644 --- a/src/common/query/src/logical_plan/udf.rs +++ b/src/common/query/src/logical_plan/udf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Udf module contains foundational types that are used to represent UDFs. //! It's modifed from datafusion. use std::fmt; diff --git a/src/common/query/src/physical_plan.rs b/src/common/query/src/physical_plan.rs index a1ebda8083..710554a957 100644 --- a/src/common/query/src/physical_plan.rs +++ b/src/common/query/src/physical_plan.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::fmt::Debug; use std::sync::Arc; diff --git a/src/common/query/src/prelude.rs b/src/common/query/src/prelude.rs index 4ca737456b..e1af6f0c41 100644 --- a/src/common/query/src/prelude.rs +++ b/src/common/query/src/prelude.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use datafusion_common::ScalarValue; pub use crate::columnar_value::ColumnarValue; diff --git a/src/common/query/src/signature.rs b/src/common/query/src/signature.rs index 4527e09c4d..3f2eae8822 100644 --- a/src/common/query/src/signature.rs +++ b/src/common/query/src/signature.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Signature module contains foundational types that are used to represent signatures, types, //! and return types of functions. //! Copied and modified from datafusion. diff --git a/src/common/recordbatch/Cargo.toml b/src/common/recordbatch/Cargo.toml index aa6aa7dfab..a823612061 100644 --- a/src/common/recordbatch/Cargo.toml +++ b/src/common/recordbatch/Cargo.toml @@ -2,10 +2,13 @@ name = "common-recordbatch" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] common-error = { path = "../error" } -datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = ["simd"] } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [ + "simd", +] } datafusion-common = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } datatypes = { path = "../../datatypes" } futures = "0.3" diff --git a/src/common/recordbatch/src/adapter.rs b/src/common/recordbatch/src/adapter.rs index afbc79d9e6..700ba32961 100644 --- a/src/common/recordbatch/src/adapter.rs +++ b/src/common/recordbatch/src/adapter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; diff --git a/src/common/recordbatch/src/error.rs b/src/common/recordbatch/src/error.rs index 2524d159bd..2425defad8 100644 --- a/src/common/recordbatch/src/error.rs +++ b/src/common/recordbatch/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Error of record batch. use std::any::Any; diff --git a/src/common/recordbatch/src/lib.rs b/src/common/recordbatch/src/lib.rs index f641365b83..71bf32bb5d 100644 --- a/src/common/recordbatch/src/lib.rs +++ b/src/common/recordbatch/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod adapter; pub mod error; mod recordbatch; diff --git a/src/common/recordbatch/src/recordbatch.rs b/src/common/recordbatch/src/recordbatch.rs index cd60b5733f..b768a2f0bc 100644 --- a/src/common/recordbatch/src/recordbatch.rs +++ b/src/common/recordbatch/src/recordbatch.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datafusion_common::record_batch::RecordBatch as DfRecordBatch; use datatypes::arrow_array::arrow_array_get; use datatypes::schema::SchemaRef; diff --git a/src/common/recordbatch/src/util.rs b/src/common/recordbatch/src/util.rs index 8a146be1c0..efe34dbfed 100644 --- a/src/common/recordbatch/src/util.rs +++ b/src/common/recordbatch/src/util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use futures::TryStreamExt; use crate::error::Result; diff --git a/src/common/runtime/Cargo.toml b/src/common/runtime/Cargo.toml index c26f33f982..1fc3e7bd0d 100644 --- a/src/common/runtime/Cargo.toml +++ b/src/common/runtime/Cargo.toml @@ -2,6 +2,7 @@ name = "common-runtime" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] common-error = { path = "../error" } diff --git a/src/common/runtime/src/error.rs b/src/common/runtime/src/error.rs index b6b5504db2..cbb561c3bb 100644 --- a/src/common/runtime/src/error.rs +++ b/src/common/runtime/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/common/runtime/src/global.rs b/src/common/runtime/src/global.rs index 2fec97b6be..10fe081e9c 100644 --- a/src/common/runtime/src/global.rs +++ b/src/common/runtime/src/global.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Global runtimes use std::future::Future; use std::sync::{Mutex, Once}; diff --git a/src/common/runtime/src/lib.rs b/src/common/runtime/src/lib.rs index 7d2c8503f5..539705f401 100644 --- a/src/common/runtime/src/lib.rs +++ b/src/common/runtime/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod error; mod global; pub mod metric; diff --git a/src/common/runtime/src/metric.rs b/src/common/runtime/src/metric.rs index 8138fdac97..88ba1e303b 100644 --- a/src/common/runtime/src/metric.rs +++ b/src/common/runtime/src/metric.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Runtime metrics pub const THREAD_NAME_LABEL: &str = "thread.name"; pub const METRIC_RUNTIME_THREADS_ALIVE: &str = "runtime.threads.alive"; diff --git a/src/common/runtime/src/runtime.rs b/src/common/runtime/src/runtime.rs index 97949494e0..4a306de649 100644 --- a/src/common/runtime/src/runtime.rs +++ b/src/common/runtime/src/runtime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::future::Future; use std::sync::Arc; use std::thread; diff --git a/src/common/substrait/Cargo.toml b/src/common/substrait/Cargo.toml index 301b8289db..0f5502c732 100644 --- a/src/common/substrait/Cargo.toml +++ b/src/common/substrait/Cargo.toml @@ -2,6 +2,7 @@ name = "substrait" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] bytes = "1.1" diff --git a/src/common/substrait/src/df_logical.rs b/src/common/substrait/src/df_logical.rs index b991004ecd..f054be910a 100644 --- a/src/common/substrait/src/df_logical.rs +++ b/src/common/substrait/src/df_logical.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use bytes::{Buf, Bytes, BytesMut}; diff --git a/src/common/substrait/src/error.rs b/src/common/substrait/src/error.rs index ad591b949c..16e6bec1aa 100644 --- a/src/common/substrait/src/error.rs +++ b/src/common/substrait/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::{BoxedError, ErrorExt, StatusCode}; diff --git a/src/common/substrait/src/lib.rs b/src/common/substrait/src/lib.rs index b5bf75e0bd..137796b527 100644 --- a/src/common/substrait/src/lib.rs +++ b/src/common/substrait/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod df_logical; pub mod error; mod schema; diff --git a/src/common/substrait/src/schema.rs b/src/common/substrait/src/schema.rs index 42a5ea9ec9..623a4e7416 100644 --- a/src/common/substrait/src/schema.rs +++ b/src/common/substrait/src/schema.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::schema::{ColumnSchema, Schema}; use substrait_proto::protobuf::r#type::{Nullability, Struct as SubstraitStruct}; use substrait_proto::protobuf::NamedStruct; diff --git a/src/common/substrait/src/types.rs b/src/common/substrait/src/types.rs index ba6cea28d1..1cd563c3ae 100644 --- a/src/common/substrait/src/types.rs +++ b/src/common/substrait/src/types.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Methods that perform convertion between Substrait's type ([Type](SType)) and GreptimeDB's type ([ConcreteDataType]). //! //! Substrait use [type variation](https://substrait.io/types/type_variations/) to express different "logical types". diff --git a/src/common/telemetry/Cargo.toml b/src/common/telemetry/Cargo.toml index ff9e69a84c..638fb9d586 100644 --- a/src/common/telemetry/Cargo.toml +++ b/src/common/telemetry/Cargo.toml @@ -2,11 +2,11 @@ name = "common-telemetry" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [features] console = ["console-subscriber"] -deadlock_detection =["parking_lot"] +deadlock_detection = ["parking_lot"] [dependencies] backtrace = "0.3" @@ -15,9 +15,14 @@ console-subscriber = { version = "0.1", optional = true } metrics = "0.20" metrics-exporter-prometheus = { version = "0.11", default-features = false } once_cell = "1.10" -opentelemetry = { version = "0.17", default-features = false, features = ["trace", "rt-tokio"] } +opentelemetry = { version = "0.17", default-features = false, features = [ + "trace", + "rt-tokio", +] } opentelemetry-jaeger = { version = "0.16", features = ["rt-tokio"] } -parking_lot = { version = "0.12", features = ["deadlock_detection"], optional = true } +parking_lot = { version = "0.12", features = [ + "deadlock_detection", +], optional = true } tracing = "0.1" tracing-appender = "0.2" tracing-bunyan-formatter = "0.3" diff --git a/src/common/telemetry/src/lib.rs b/src/common/telemetry/src/lib.rs index ed3dd5a79a..e8e92cfe6f 100644 --- a/src/common/telemetry/src/lib.rs +++ b/src/common/telemetry/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod logging; mod macros; pub mod metric; diff --git a/src/common/telemetry/src/logging.rs b/src/common/telemetry/src/logging.rs index 2698e2e3f6..6407e04dfa 100644 --- a/src/common/telemetry/src/logging.rs +++ b/src/common/telemetry/src/logging.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! logging stuffs, inspired by databend use std::env; use std::sync::{Arc, Mutex, Once}; diff --git a/src/common/telemetry/src/macros.rs b/src/common/telemetry/src/macros.rs index ccd552db05..d2be6b9e02 100644 --- a/src/common/telemetry/src/macros.rs +++ b/src/common/telemetry/src/macros.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// The standard logging macro. #[macro_export] macro_rules! log { diff --git a/src/common/telemetry/src/metric.rs b/src/common/telemetry/src/metric.rs index ad35c85473..d0cbd537ee 100644 --- a/src/common/telemetry/src/metric.rs +++ b/src/common/telemetry/src/metric.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // metric stuffs, inspired by databend use std::sync::{Arc, Once, RwLock}; diff --git a/src/common/telemetry/src/panic_hook.rs b/src/common/telemetry/src/panic_hook.rs index 0895450b81..e29a832637 100644 --- a/src/common/telemetry/src/panic_hook.rs +++ b/src/common/telemetry/src/panic_hook.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::panic; #[cfg(feature = "deadlock_detection")] use std::time::Duration; diff --git a/src/common/time/Cargo.toml b/src/common/time/Cargo.toml index 37c0fa89fc..e76c4d0b6d 100644 --- a/src/common/time/Cargo.toml +++ b/src/common/time/Cargo.toml @@ -2,7 +2,7 @@ name = "common-time" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] chrono = "0.4" diff --git a/src/common/time/src/date.rs b/src/common/time/src/date.rs index 5f67a4b8a0..30e4529063 100644 --- a/src/common/time/src/date.rs +++ b/src/common/time/src/date.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::{Display, Formatter}; use std::str::FromStr; diff --git a/src/common/time/src/datetime.rs b/src/common/time/src/datetime.rs index 88b34a2c50..4055a07429 100644 --- a/src/common/time/src/datetime.rs +++ b/src/common/time/src/datetime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::{Display, Formatter}; use std::str::FromStr; diff --git a/src/common/time/src/error.rs b/src/common/time/src/error.rs index 136ce21780..73e3af5773 100644 --- a/src/common/time/src/error.rs +++ b/src/common/time/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use chrono::ParseError; use snafu::{Backtrace, Snafu}; diff --git a/src/common/time/src/lib.rs b/src/common/time/src/lib.rs index 44c907e7cb..98788a35c3 100644 --- a/src/common/time/src/lib.rs +++ b/src/common/time/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod date; pub mod datetime; pub mod error; diff --git a/src/common/time/src/range.rs b/src/common/time/src/range.rs index ef2985a54e..6c72fdf5b6 100644 --- a/src/common/time/src/range.rs +++ b/src/common/time/src/range.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::timestamp_millis::TimestampMillis; /// A half-open time range. diff --git a/src/common/time/src/timestamp.rs b/src/common/time/src/timestamp.rs index d3538d78b5..fd0f148d96 100644 --- a/src/common/time/src/timestamp.rs +++ b/src/common/time/src/timestamp.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use core::default::Default; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; diff --git a/src/common/time/src/timestamp_millis.rs b/src/common/time/src/timestamp_millis.rs index 939bb8bbd1..d3da8bd58e 100644 --- a/src/common/time/src/timestamp_millis.rs +++ b/src/common/time/src/timestamp_millis.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; /// Unix timestamp in millisecond resolution. diff --git a/src/common/time/src/util.rs b/src/common/time/src/util.rs index e0ec824818..3d3baebc2e 100644 --- a/src/common/time/src/util.rs +++ b/src/common/time/src/util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Returns the time duration since UNIX_EPOCH in milliseconds. pub fn current_time_millis() -> i64 { chrono::Utc::now().timestamp_millis() diff --git a/src/datanode/Cargo.toml b/src/datanode/Cargo.toml index a97c11a715..c722c328d7 100644 --- a/src/datanode/Cargo.toml +++ b/src/datanode/Cargo.toml @@ -2,6 +2,7 @@ name = "datanode" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [features] default = ["python"] diff --git a/src/datanode/src/datanode.rs b/src/datanode/src/datanode.rs index 669ac2bf94..78da04cea7 100644 --- a/src/datanode/src/datanode.rs +++ b/src/datanode/src/datanode.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_telemetry::info; diff --git a/src/datanode/src/error.rs b/src/datanode/src/error.rs index 5b69570629..f5593db57c 100644 --- a/src/datanode/src/error.rs +++ b/src/datanode/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/datanode/src/heartbeat.rs b/src/datanode/src/heartbeat.rs index 17a2a140a4..37431574eb 100644 --- a/src/datanode/src/heartbeat.rs +++ b/src/datanode/src/heartbeat.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; diff --git a/src/datanode/src/instance.rs b/src/datanode/src/instance.rs index a0543fd934..5095b9e91b 100644 --- a/src/datanode/src/instance.rs +++ b/src/datanode/src/instance.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use std::time::Duration; use std::{fs, path}; diff --git a/src/datanode/src/instance/grpc.rs b/src/datanode/src/instance/grpc.rs index 1596cd3824..5a58709d45 100644 --- a/src/datanode/src/instance/grpc.rs +++ b/src/datanode/src/instance/grpc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::result::{build_err_result, AdminResultBuilder, ObjectResultBuilder}; use api::v1::{ admin_expr, insert_expr, object_expr, select_expr, AdminExpr, AdminResult, CreateDatabaseExpr, diff --git a/src/datanode/src/instance/script.rs b/src/datanode/src/instance/script.rs index c279fba3c1..c60a615677 100644 --- a/src/datanode/src/instance/script.rs +++ b/src/datanode/src/instance/script.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_query::Output; use common_telemetry::timer; diff --git a/src/datanode/src/instance/sql.rs b/src/datanode/src/instance/sql.rs index ae5542d750..fb198f5b75 100644 --- a/src/datanode/src/instance/sql.rs +++ b/src/datanode/src/instance/sql.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_error::prelude::BoxedError; use common_query::Output; diff --git a/src/datanode/src/lib.rs b/src/datanode/src/lib.rs index bcf7097377..8540c851f6 100644 --- a/src/datanode/src/lib.rs +++ b/src/datanode/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] pub mod datanode; diff --git a/src/datanode/src/metric.rs b/src/datanode/src/metric.rs index fbdf0e3f93..97c7197bcf 100644 --- a/src/datanode/src/metric.rs +++ b/src/datanode/src/metric.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! datanode metrics pub const METRIC_HANDLE_SQL_ELAPSED: &str = "datanode.handle_sql_elapsed"; diff --git a/src/datanode/src/mock.rs b/src/datanode/src/mock.rs index 4c8720bec8..d0ed8f6227 100644 --- a/src/datanode/src/mock.rs +++ b/src/datanode/src/mock.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::Arc; diff --git a/src/datanode/src/script.rs b/src/datanode/src/script.rs index bdf9dee350..f8ebea4e1e 100644 --- a/src/datanode/src/script.rs +++ b/src/datanode/src/script.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use catalog::CatalogManagerRef; use common_query::Output; use query::QueryEngineRef; diff --git a/src/datanode/src/server.rs b/src/datanode/src/server.rs index caeb1c936f..9abd08ae3c 100644 --- a/src/datanode/src/server.rs +++ b/src/datanode/src/server.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::default::Default; use std::net::SocketAddr; use std::sync::Arc; diff --git a/src/datanode/src/server/grpc.rs b/src/datanode/src/server/grpc.rs index 13988d2c7d..2900ba751c 100644 --- a/src/datanode/src/server/grpc.rs +++ b/src/datanode/src/server/grpc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod ddl; pub(crate) mod plan; pub mod select; diff --git a/src/datanode/src/server/grpc/ddl.rs b/src/datanode/src/server/grpc/ddl.rs index 4247d542ab..1a0a650cf1 100644 --- a/src/datanode/src/server/grpc/ddl.rs +++ b/src/datanode/src/server/grpc/ddl.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::helper::ColumnDataTypeWrapper; diff --git a/src/datanode/src/server/grpc/plan.rs b/src/datanode/src/server/grpc/plan.rs index 0a8dd11c96..48974d1075 100644 --- a/src/datanode/src/server/grpc/plan.rs +++ b/src/datanode/src/server/grpc/plan.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_grpc::{AsExcutionPlan, DefaultAsPlanImpl}; diff --git a/src/datanode/src/server/grpc/select.rs b/src/datanode/src/server/grpc/select.rs index 431fbaf321..769cb62f08 100644 --- a/src/datanode/src/server/grpc/select.rs +++ b/src/datanode/src/server/grpc/select.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::helper::ColumnDataTypeWrapper; diff --git a/src/datanode/src/sql.rs b/src/datanode/src/sql.rs index 16554fa314..01b3247c7e 100644 --- a/src/datanode/src/sql.rs +++ b/src/datanode/src/sql.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! sql handler use catalog::CatalogManagerRef; diff --git a/src/datanode/src/sql/alter.rs b/src/datanode/src/sql/alter.rs index 87ca827850..b30dc9c5ac 100644 --- a/src/datanode/src/sql/alter.rs +++ b/src/datanode/src/sql/alter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use common_query::Output; use snafu::prelude::*; diff --git a/src/datanode/src/sql/create.rs b/src/datanode/src/sql/create.rs index 98a1bf1621..d02de70211 100644 --- a/src/datanode/src/sql/create.rs +++ b/src/datanode/src/sql/create.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/datanode/src/sql/insert.rs b/src/datanode/src/sql/insert.rs index 673e9a490f..00aa59a026 100644 --- a/src/datanode/src/sql/insert.rs +++ b/src/datanode/src/sql/insert.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use catalog::SchemaProviderRef; use common_query::Output; use datatypes::prelude::{ConcreteDataType, VectorBuilder}; diff --git a/src/datanode/src/tests.rs b/src/datanode/src/tests.rs index 3678ed339b..5cb02b3453 100644 --- a/src/datanode/src/tests.rs +++ b/src/datanode/src/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod grpc_test; mod http_test; mod instance_test; diff --git a/src/datanode/src/tests/grpc_test.rs b/src/datanode/src/tests/grpc_test.rs index 20865e4a6a..2ae06ff8dd 100644 --- a/src/datanode/src/tests/grpc_test.rs +++ b/src/datanode/src/tests/grpc_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::assert_matches::assert_matches; use std::collections::HashMap; use std::net::SocketAddr; diff --git a/src/datanode/src/tests/http_test.rs b/src/datanode/src/tests/http_test.rs index 187cb6414d..7348fb6430 100644 --- a/src/datanode/src/tests/http_test.rs +++ b/src/datanode/src/tests/http_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use axum::http::StatusCode; diff --git a/src/datanode/src/tests/instance_test.rs b/src/datanode/src/tests/instance_test.rs index 501821e552..5f0b9d1104 100644 --- a/src/datanode/src/tests/instance_test.rs +++ b/src/datanode/src/tests/instance_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use arrow::array::{Int64Array, UInt64Array, Utf8Array}; use common_query::Output; use common_recordbatch::util; diff --git a/src/datanode/src/tests/test_util.rs b/src/datanode/src/tests/test_util.rs index 3c63b844c4..497167c302 100644 --- a/src/datanode/src/tests/test_util.rs +++ b/src/datanode/src/tests/test_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/datatypes/Cargo.toml b/src/datatypes/Cargo.toml index 708b521b67..5c66508dd1 100644 --- a/src/datatypes/Cargo.toml +++ b/src/datatypes/Cargo.toml @@ -2,6 +2,7 @@ name = "datatypes" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [features] default = [] @@ -24,4 +25,13 @@ snafu = { version = "0.7", features = ["backtraces"] } [dependencies.arrow] package = "arrow2" version = "0.10" -features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "ahash", "compute", "serde_types"] +features = [ + "io_csv", + "io_json", + "io_parquet", + "io_parquet_compression", + "io_ipc", + "ahash", + "compute", + "serde_types", +] diff --git a/src/datatypes/src/arrow_array.rs b/src/datatypes/src/arrow_array.rs index ea982a84d1..1c46932ab8 100644 --- a/src/datatypes/src/arrow_array.rs +++ b/src/datatypes/src/arrow_array.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use arrow::array::{ self, Array, BinaryArray as ArrowBinaryArray, ListArray, MutableBinaryArray as ArrowMutableBinaryArray, MutableUtf8Array, PrimitiveArray, Utf8Array, diff --git a/src/datatypes/src/data_type.rs b/src/datatypes/src/data_type.rs index 778bf79e10..ddd3e3f4bc 100644 --- a/src/datatypes/src/data_type.rs +++ b/src/datatypes/src/data_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/deserialize.rs b/src/datatypes/src/deserialize.rs deleted file mode 100644 index 8b13789179..0000000000 --- a/src/datatypes/src/deserialize.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/datatypes/src/error.rs b/src/datatypes/src/error.rs index 52cefb3026..50b49cf2b4 100644 --- a/src/datatypes/src/error.rs +++ b/src/datatypes/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::{ErrorCompat, ErrorExt, Snafu, StatusCode}; diff --git a/src/datatypes/src/lib.rs b/src/datatypes/src/lib.rs index 1a3a36f686..f6f6db112a 100644 --- a/src/datatypes/src/lib.rs +++ b/src/datatypes/src/lib.rs @@ -1,9 +1,22 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(generic_associated_types)] #![feature(assert_matches)] pub mod arrow_array; pub mod data_type; -pub mod deserialize; pub mod error; pub mod macros; pub mod prelude; diff --git a/src/datatypes/src/macros.rs b/src/datatypes/src/macros.rs index fb94195e38..18be9fa375 100644 --- a/src/datatypes/src/macros.rs +++ b/src/datatypes/src/macros.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + ///! Some helper macros for datatypes, copied from databend. #[macro_export] macro_rules! for_all_scalar_types { diff --git a/src/datatypes/src/prelude.rs b/src/datatypes/src/prelude.rs index d3e405204f..014a40efaf 100644 --- a/src/datatypes/src/prelude.rs +++ b/src/datatypes/src/prelude.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use crate::data_type::{ConcreteDataType, DataType, DataTypeRef}; pub use crate::macros::*; pub use crate::scalars::{Scalar, ScalarRef, ScalarVector, ScalarVectorBuilder}; diff --git a/src/datatypes/src/scalars.rs b/src/datatypes/src/scalars.rs index 53b105434b..ddb8eff007 100644 --- a/src/datatypes/src/scalars.rs +++ b/src/datatypes/src/scalars.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_time::{Date, DateTime, Timestamp}; diff --git a/src/datatypes/src/schema.rs b/src/datatypes/src/schema.rs index 41e4b28496..cb3df93896 100644 --- a/src/datatypes/src/schema.rs +++ b/src/datatypes/src/schema.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod constraint; mod raw; diff --git a/src/datatypes/src/schema/constraint.rs b/src/datatypes/src/schema/constraint.rs index 1b17346869..2d2d5e0c36 100644 --- a/src/datatypes/src/schema/constraint.rs +++ b/src/datatypes/src/schema/constraint.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_time::util; diff --git a/src/datatypes/src/schema/raw.rs b/src/datatypes/src/schema/raw.rs index 8e70d9d0ea..f415a1ab85 100644 --- a/src/datatypes/src/schema/raw.rs +++ b/src/datatypes/src/schema/raw.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; use crate::error::{Error, Result}; diff --git a/src/datatypes/src/serialize.rs b/src/datatypes/src/serialize.rs index d20bbc313e..1cbf04cedd 100644 --- a/src/datatypes/src/serialize.rs +++ b/src/datatypes/src/serialize.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::error::Result; pub trait Serializable: Send + Sync { diff --git a/src/datatypes/src/type_id.rs b/src/datatypes/src/type_id.rs index 0f96bbc083..fa11430dec 100644 --- a/src/datatypes/src/type_id.rs +++ b/src/datatypes/src/type_id.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Unique identifier for logical data type. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum LogicalTypeId { diff --git a/src/datatypes/src/types.rs b/src/datatypes/src/types.rs index 3bb5bfdb93..aabeb59db3 100644 --- a/src/datatypes/src/types.rs +++ b/src/datatypes/src/types.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod binary_type; mod boolean_type; mod date; diff --git a/src/datatypes/src/types/binary_type.rs b/src/datatypes/src/types/binary_type.rs index 5cbe9330b4..13922ff063 100644 --- a/src/datatypes/src/types/binary_type.rs +++ b/src/datatypes/src/types/binary_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/boolean_type.rs b/src/datatypes/src/types/boolean_type.rs index dea059662b..4566f1d826 100644 --- a/src/datatypes/src/types/boolean_type.rs +++ b/src/datatypes/src/types/boolean_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/date.rs b/src/datatypes/src/types/date.rs index d2f57632bf..8d2cca12fa 100644 --- a/src/datatypes/src/types/date.rs +++ b/src/datatypes/src/types/date.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/datetime.rs b/src/datatypes/src/types/datetime.rs index d12260f366..6166c73f37 100644 --- a/src/datatypes/src/types/datetime.rs +++ b/src/datatypes/src/types/datetime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/list_type.rs b/src/datatypes/src/types/list_type.rs index bb95b3fc10..1ada109011 100644 --- a/src/datatypes/src/types/list_type.rs +++ b/src/datatypes/src/types/list_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use arrow::datatypes::{DataType as ArrowDataType, Field}; use serde::{Deserialize, Serialize}; diff --git a/src/datatypes/src/types/null_type.rs b/src/datatypes/src/types/null_type.rs index 9b18590515..a0b027dd14 100644 --- a/src/datatypes/src/types/null_type.rs +++ b/src/datatypes/src/types/null_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/primitive_traits.rs b/src/datatypes/src/types/primitive_traits.rs index 941d857349..e900ba217e 100644 --- a/src/datatypes/src/types/primitive_traits.rs +++ b/src/datatypes/src/types/primitive_traits.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use arrow::compute::arithmetics::basic::NativeArithmetics; diff --git a/src/datatypes/src/types/primitive_type.rs b/src/datatypes/src/types/primitive_type.rs index 19418544f5..b9f07ce82c 100644 --- a/src/datatypes/src/types/primitive_type.rs +++ b/src/datatypes/src/types/primitive_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::TypeId; use std::marker::PhantomData; diff --git a/src/datatypes/src/types/string_type.rs b/src/datatypes/src/types/string_type.rs index c47da8f1bd..736a3faac9 100644 --- a/src/datatypes/src/types/string_type.rs +++ b/src/datatypes/src/types/string_type.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType as ArrowDataType; diff --git a/src/datatypes/src/types/timestamp.rs b/src/datatypes/src/types/timestamp.rs index c527419bcf..b80d16a64f 100644 --- a/src/datatypes/src/types/timestamp.rs +++ b/src/datatypes/src/types/timestamp.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use arrow::datatypes::{DataType as ArrowDataType, TimeUnit as ArrowTimeUnit}; use common_time::timestamp::{TimeUnit, Timestamp}; use serde::{Deserialize, Serialize}; diff --git a/src/datatypes/src/value.rs b/src/datatypes/src/value.rs index 06adf9990a..7a52e370f5 100644 --- a/src/datatypes/src/value.rs +++ b/src/datatypes/src/value.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use common_base::bytes::{Bytes, StringBytes}; diff --git a/src/datatypes/src/vectors.rs b/src/datatypes/src/vectors.rs index 6ba9ac841f..8395daaf1c 100644 --- a/src/datatypes/src/vectors.rs +++ b/src/datatypes/src/vectors.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod binary; pub mod boolean; mod builder; diff --git a/src/datatypes/src/vectors/binary.rs b/src/datatypes/src/vectors/binary.rs index 74b7cf05a3..817b29bca0 100644 --- a/src/datatypes/src/vectors/binary.rs +++ b/src/datatypes/src/vectors/binary.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/boolean.rs b/src/datatypes/src/vectors/boolean.rs index c1d98fa0f2..fc1302f2c6 100644 --- a/src/datatypes/src/vectors/boolean.rs +++ b/src/datatypes/src/vectors/boolean.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::borrow::Borrow; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/builder.rs b/src/datatypes/src/vectors/builder.rs index 5e97203b00..67ab2513ab 100644 --- a/src/datatypes/src/vectors/builder.rs +++ b/src/datatypes/src/vectors/builder.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_time::date::Date; diff --git a/src/datatypes/src/vectors/constant.rs b/src/datatypes/src/vectors/constant.rs index d793f7519e..d5522007a1 100644 --- a/src/datatypes/src/vectors/constant.rs +++ b/src/datatypes/src/vectors/constant.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::fmt; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/date.rs b/src/datatypes/src/vectors/date.rs index 060cb892a5..0198b3622f 100644 --- a/src/datatypes/src/vectors/date.rs +++ b/src/datatypes/src/vectors/date.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/datetime.rs b/src/datatypes/src/vectors/datetime.rs index 9bd36cc165..732e56004c 100644 --- a/src/datatypes/src/vectors/datetime.rs +++ b/src/datatypes/src/vectors/datetime.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/eq.rs b/src/datatypes/src/vectors/eq.rs index ea979b1c53..d47167c3f9 100644 --- a/src/datatypes/src/vectors/eq.rs +++ b/src/datatypes/src/vectors/eq.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use crate::data_type::DataType; diff --git a/src/datatypes/src/vectors/helper.rs b/src/datatypes/src/vectors/helper.rs index b5de1b0b65..60a9f8511f 100644 --- a/src/datatypes/src/vectors/helper.rs +++ b/src/datatypes/src/vectors/helper.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Vector helper functions, inspired by databend Series mod use std::any::Any; diff --git a/src/datatypes/src/vectors/list.rs b/src/datatypes/src/vectors/list.rs index d5bb24bcfc..76d9dd8717 100644 --- a/src/datatypes/src/vectors/list.rs +++ b/src/datatypes/src/vectors/list.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::ops::Range; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/mutable.rs b/src/datatypes/src/vectors/mutable.rs index 1dd6ff78a3..5f94957460 100644 --- a/src/datatypes/src/vectors/mutable.rs +++ b/src/datatypes/src/vectors/mutable.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use crate::error::Result; diff --git a/src/datatypes/src/vectors/null.rs b/src/datatypes/src/vectors/null.rs index 6f01123e2f..64974d99b0 100644 --- a/src/datatypes/src/vectors/null.rs +++ b/src/datatypes/src/vectors/null.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::fmt; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/operations.rs b/src/datatypes/src/vectors/operations.rs index 7ec3b547b5..6caf8fe300 100644 --- a/src/datatypes/src/vectors/operations.rs +++ b/src/datatypes/src/vectors/operations.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod filter; mod find_unique; mod replicate; diff --git a/src/datatypes/src/vectors/operations/filter.rs b/src/datatypes/src/vectors/operations/filter.rs index 4ae0398047..7a9f514a16 100644 --- a/src/datatypes/src/vectors/operations/filter.rs +++ b/src/datatypes/src/vectors/operations/filter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) use crate::vectors::constant::filter_constant; macro_rules! filter_non_constant { diff --git a/src/datatypes/src/vectors/operations/find_unique.rs b/src/datatypes/src/vectors/operations/find_unique.rs index a077c4516f..3aade173ac 100644 --- a/src/datatypes/src/vectors/operations/find_unique.rs +++ b/src/datatypes/src/vectors/operations/find_unique.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use arrow::bitmap::MutableBitmap; use crate::scalars::ScalarVector; diff --git a/src/datatypes/src/vectors/operations/replicate.rs b/src/datatypes/src/vectors/operations/replicate.rs index 340250d19e..7fb93134ed 100644 --- a/src/datatypes/src/vectors/operations/replicate.rs +++ b/src/datatypes/src/vectors/operations/replicate.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::prelude::*; pub(crate) use crate::vectors::constant::replicate_constant; pub(crate) use crate::vectors::date::replicate_date; diff --git a/src/datatypes/src/vectors/primitive.rs b/src/datatypes/src/vectors/primitive.rs index 6c4521b697..c49295630c 100644 --- a/src/datatypes/src/vectors/primitive.rs +++ b/src/datatypes/src/vectors/primitive.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::iter::FromIterator; use std::slice::Iter; diff --git a/src/datatypes/src/vectors/string.rs b/src/datatypes/src/vectors/string.rs index fc75153581..638b04dd3e 100644 --- a/src/datatypes/src/vectors/string.rs +++ b/src/datatypes/src/vectors/string.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/datatypes/src/vectors/timestamp.rs b/src/datatypes/src/vectors/timestamp.rs index 0b47dc1f5e..62b8332c89 100644 --- a/src/datatypes/src/vectors/timestamp.rs +++ b/src/datatypes/src/vectors/timestamp.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/frontend/Cargo.toml b/src/frontend/Cargo.toml index d9b7de4219..0324f7d855 100644 --- a/src/frontend/Cargo.toml +++ b/src/frontend/Cargo.toml @@ -2,6 +2,7 @@ name = "frontend" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] api = { path = "../api" } @@ -20,7 +21,9 @@ common-runtime = { path = "../common/runtime" } common-telemetry = { path = "../common/telemetry" } common-time = { path = "../common/time" } common-insert = { path = "../common/insert" } -datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = ["simd"] } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [ + "simd", +] } datafusion-common = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } datafusion-expr = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } @@ -46,7 +49,16 @@ tokio = { version = "1.18", features = ["full"] } [dependencies.arrow] package = "arrow2" version = "0.10" -features = ["io_csv", "io_json", "io_parquet", "io_parquet_compression", "io_ipc", "ahash", "compute", "serde_types"] +features = [ + "io_csv", + "io_json", + "io_parquet", + "io_parquet_compression", + "io_ipc", + "ahash", + "compute", + "serde_types", +] [dev-dependencies] datanode = { path = "../datanode" } diff --git a/src/frontend/src/catalog.rs b/src/frontend/src/catalog.rs index f725d7a4c5..0cd4e9a30e 100644 --- a/src/frontend/src/catalog.rs +++ b/src/frontend/src/catalog.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::collections::HashSet; use std::sync::Arc; diff --git a/src/frontend/src/datanode.rs b/src/frontend/src/datanode.rs index 9884e70731..c365ff2c33 100644 --- a/src/frontend/src/datanode.rs +++ b/src/frontend/src/datanode.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::time::Duration; use client::Client; diff --git a/src/frontend/src/error.rs b/src/frontend/src/error.rs index a15910d41b..ad5ba0a6e7 100644 --- a/src/frontend/src/error.rs +++ b/src/frontend/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/frontend/src/expr_factory.rs b/src/frontend/src/expr_factory.rs index 4e554cbcd6..c8c7646c2c 100644 --- a/src/frontend/src/expr_factory.rs +++ b/src/frontend/src/expr_factory.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/frontend/src/frontend.rs b/src/frontend/src/frontend.rs index 2b3a36e3a1..c35b9a61c5 100644 --- a/src/frontend/src/frontend.rs +++ b/src/frontend/src/frontend.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use serde::{Deserialize, Serialize}; diff --git a/src/frontend/src/grpc.rs b/src/frontend/src/grpc.rs index c85244d4f7..8c20556f1a 100644 --- a/src/frontend/src/grpc.rs +++ b/src/frontend/src/grpc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/influxdb.rs b/src/frontend/src/influxdb.rs index da96bc9989..dc5dcec4ea 100644 --- a/src/frontend/src/influxdb.rs +++ b/src/frontend/src/influxdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/instance.rs b/src/frontend/src/instance.rs index 687c21fc8b..e34e8a271f 100644 --- a/src/frontend/src/instance.rs +++ b/src/frontend/src/instance.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) mod distributed; mod influxdb; mod opentsdb; diff --git a/src/frontend/src/instance/distributed.rs b/src/frontend/src/instance/distributed.rs index e8e14fdd82..ced630b618 100644 --- a/src/frontend/src/instance/distributed.rs +++ b/src/frontend/src/instance/distributed.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/frontend/src/instance/influxdb.rs b/src/frontend/src/instance/influxdb.rs index c938a4591a..e81639fa3a 100644 --- a/src/frontend/src/instance/influxdb.rs +++ b/src/frontend/src/instance/influxdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::codec::InsertBatch; diff --git a/src/frontend/src/instance/opentsdb.rs b/src/frontend/src/instance/opentsdb.rs index 75fe56f321..7ad21fd595 100644 --- a/src/frontend/src/instance/opentsdb.rs +++ b/src/frontend/src/instance/opentsdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_error::prelude::BoxedError; use servers::error as server_error; diff --git a/src/frontend/src/instance/prometheus.rs b/src/frontend/src/instance/prometheus.rs index 97b77d5266..224cb6bed7 100644 --- a/src/frontend/src/instance/prometheus.rs +++ b/src/frontend/src/instance/prometheus.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::prometheus::remote::read_request::ResponseType; use api::prometheus::remote::{Query, QueryResult, ReadRequest, ReadResponse, WriteRequest}; use async_trait::async_trait; diff --git a/src/frontend/src/lib.rs b/src/frontend/src/lib.rs index a849b09f8d..1059f1081d 100644 --- a/src/frontend/src/lib.rs +++ b/src/frontend/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] mod catalog; diff --git a/src/frontend/src/mock.rs b/src/frontend/src/mock.rs index d7835d6c7e..9dfbcd256b 100644 --- a/src/frontend/src/mock.rs +++ b/src/frontend/src/mock.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // FIXME(LFC): no mock use std::fmt::Formatter; diff --git a/src/frontend/src/mysql.rs b/src/frontend/src/mysql.rs index f1d688790e..56ef19834a 100644 --- a/src/frontend/src/mysql.rs +++ b/src/frontend/src/mysql.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/opentsdb.rs b/src/frontend/src/opentsdb.rs index 2752167342..c905189a17 100644 --- a/src/frontend/src/opentsdb.rs +++ b/src/frontend/src/opentsdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/partitioning.rs b/src/frontend/src/partitioning.rs index a71cdb9888..e83e3bc454 100644 --- a/src/frontend/src/partitioning.rs +++ b/src/frontend/src/partitioning.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) mod columns; pub(crate) mod range; diff --git a/src/frontend/src/partitioning/columns.rs b/src/frontend/src/partitioning/columns.rs index ad5194f0dc..3d8704906e 100644 --- a/src/frontend/src/partitioning/columns.rs +++ b/src/frontend/src/partitioning/columns.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use datafusion_expr::Operator; diff --git a/src/frontend/src/partitioning/range.rs b/src/frontend/src/partitioning/range.rs index 518c2f9d3c..dc02a02d2f 100644 --- a/src/frontend/src/partitioning/range.rs +++ b/src/frontend/src/partitioning/range.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use datatypes::prelude::*; diff --git a/src/frontend/src/postgres.rs b/src/frontend/src/postgres.rs index 930764cc40..a77243ce37 100644 --- a/src/frontend/src/postgres.rs +++ b/src/frontend/src/postgres.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/prometheus.rs b/src/frontend/src/prometheus.rs index 2d4a1633cf..3a56e1d8fb 100644 --- a/src/frontend/src/prometheus.rs +++ b/src/frontend/src/prometheus.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/src/frontend/src/server.rs b/src/frontend/src/server.rs index da4ee51c5e..9ba9587600 100644 --- a/src/frontend/src/server.rs +++ b/src/frontend/src/server.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::net::SocketAddr; use std::sync::Arc; diff --git a/src/frontend/src/spliter.rs b/src/frontend/src/spliter.rs index c9ed76f172..06fc9eca8e 100644 --- a/src/frontend/src/spliter.rs +++ b/src/frontend/src/spliter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use datatypes::value::Value; diff --git a/src/frontend/src/sql.rs b/src/frontend/src/sql.rs index fdafa8d172..f888d5e836 100644 --- a/src/frontend/src/sql.rs +++ b/src/frontend/src/sql.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use catalog::SchemaProviderRef; use common_error::snafu::ensure; use datatypes::prelude::ConcreteDataType; diff --git a/src/frontend/src/table.rs b/src/frontend/src/table.rs index c63e622224..9d34f1a81c 100644 --- a/src/frontend/src/table.rs +++ b/src/frontend/src/table.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) mod route; use std::any::Any; diff --git a/src/frontend/src/table/insert.rs b/src/frontend/src/table/insert.rs index b7f3afd7f2..09dabcb02a 100644 --- a/src/frontend/src/table/insert.rs +++ b/src/frontend/src/table/insert.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/frontend/src/table/route.rs b/src/frontend/src/table/route.rs index 051e73d4cf..eaeb3e14c0 100644 --- a/src/frontend/src/table/route.rs +++ b/src/frontend/src/table/route.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use std::time::Duration; diff --git a/src/frontend/src/tests.rs b/src/frontend/src/tests.rs index 5ea03cbb6a..18ec172c10 100644 --- a/src/frontend/src/tests.rs +++ b/src/frontend/src/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use client::Client; diff --git a/src/log-store/Cargo.toml b/src/log-store/Cargo.toml index c9c1f8c18c..77dcd45619 100644 --- a/src/log-store/Cargo.toml +++ b/src/log-store/Cargo.toml @@ -2,7 +2,7 @@ name = "log-store" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] arc-swap = "1.5" diff --git a/src/log-store/src/error.rs b/src/log-store/src/error.rs index 6fed0f1163..9b26e3db4d 100644 --- a/src/log-store/src/error.rs +++ b/src/log-store/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::BoxedError; diff --git a/src/log-store/src/fs.rs b/src/log-store/src/fs.rs index 922e6813e3..e8f334be49 100644 --- a/src/log-store/src/fs.rs +++ b/src/log-store/src/fs.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use store_api::logstore::entry::{Id, Offset}; use store_api::logstore::AppendResponse; diff --git a/src/log-store/src/fs/chunk.rs b/src/log-store/src/fs/chunk.rs index bd5d07ae5f..d123684cd9 100644 --- a/src/log-store/src/fs/chunk.rs +++ b/src/log-store/src/fs/chunk.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::LinkedList; use common_base::buffer::{Buffer, UnderflowSnafu}; diff --git a/src/log-store/src/fs/config.rs b/src/log-store/src/fs/config.rs index acdc565245..c46abcd5a4 100644 --- a/src/log-store/src/fs/config.rs +++ b/src/log-store/src/fs/config.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[derive(Debug, Clone)] pub struct LogConfig { pub append_buffer_size: usize, diff --git a/src/log-store/src/fs/crc.rs b/src/log-store/src/fs/crc.rs index 2e620ca1c3..7410d21616 100644 --- a/src/log-store/src/fs/crc.rs +++ b/src/log-store/src/fs/crc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crc::{Crc, CRC_32_ISCSI}; pub const CRC_ALGO: Crc = Crc::::new(&CRC_32_ISCSI); diff --git a/src/log-store/src/fs/entry.rs b/src/log-store/src/fs/entry.rs index face0cd032..5bc92cadbb 100644 --- a/src/log-store/src/fs/entry.rs +++ b/src/log-store/src/fs/entry.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::pin::Pin; use std::task::{Context, Poll}; diff --git a/src/log-store/src/fs/file.rs b/src/log-store/src/fs/file.rs index 8f153b07f7..57c7ade569 100644 --- a/src/log-store/src/fs/file.rs +++ b/src/log-store/src/fs/file.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::{Debug, Formatter}; use std::fs::{File, OpenOptions}; use std::pin::Pin; diff --git a/src/log-store/src/fs/file_name.rs b/src/log-store/src/fs/file_name.rs index 854b306103..b4b04968f0 100644 --- a/src/log-store/src/fs/file_name.rs +++ b/src/log-store/src/fs/file_name.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::{Display, Formatter}; use std::path::Path; diff --git a/src/log-store/src/fs/index.rs b/src/log-store/src/fs/index.rs index ba32d4b578..2d1a0da580 100644 --- a/src/log-store/src/fs/index.rs +++ b/src/log-store/src/fs/index.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::BTreeMap; use std::sync::RwLock; diff --git a/src/log-store/src/fs/io.rs b/src/log-store/src/fs/io.rs index c63d4d5d07..0d4bb2dd55 100644 --- a/src/log-store/src/fs/io.rs +++ b/src/log-store/src/fs/io.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[cfg(all(unix, not(miri)))] mod unix; // todo(hl): maybe support windows seek_write/seek_read diff --git a/src/log-store/src/fs/io/fallback.rs b/src/log-store/src/fs/io/fallback.rs index 7a6ed5ce83..a56ca4538a 100644 --- a/src/log-store/src/fs/io/fallback.rs +++ b/src/log-store/src/fs/io/fallback.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::convert::TryFrom; use std::fs::File; diff --git a/src/log-store/src/fs/io/unix.rs b/src/log-store/src/fs/io/unix.rs index f2912a3b73..09dc2bf921 100644 --- a/src/log-store/src/fs/io/unix.rs +++ b/src/log-store/src/fs/io/unix.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fs::File; use std::os::unix::fs::FileExt; diff --git a/src/log-store/src/fs/log.rs b/src/log-store/src/fs/log.rs index 1019284d0d..0ecd0c0a3d 100644 --- a/src/log-store/src/fs/log.rs +++ b/src/log-store/src/fs/log.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::BTreeMap; use std::path::Path; use std::sync::Arc; diff --git a/src/log-store/src/fs/namespace.rs b/src/log-store/src/fs/namespace.rs index a0f71ea7f8..97a833a1d0 100644 --- a/src/log-store/src/fs/namespace.rs +++ b/src/log-store/src/fs/namespace.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use store_api::logstore::namespace::{Id, Namespace}; #[derive(Clone, Debug)] diff --git a/src/log-store/src/fs/noop.rs b/src/log-store/src/fs/noop.rs index 5842811311..8d52f3fad7 100644 --- a/src/log-store/src/fs/noop.rs +++ b/src/log-store/src/fs/noop.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use store_api::logstore::entry::Id; use store_api::logstore::namespace::Id as NamespaceId; use store_api::logstore::LogStore; diff --git a/src/log-store/src/lib.rs b/src/log-store/src/lib.rs index 9e5afc2ab9..0cd3815d07 100644 --- a/src/log-store/src/lib.rs +++ b/src/log-store/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod error; pub mod fs; diff --git a/src/log-store/src/test_util.rs b/src/log-store/src/test_util.rs index e49007c802..4c04334acc 100644 --- a/src/log-store/src/test_util.rs +++ b/src/log-store/src/test_util.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod log_store_util; diff --git a/src/log-store/src/test_util/log_store_util.rs b/src/log-store/src/test_util/log_store_util.rs index 2c9d2ad39d..fb11928ae3 100644 --- a/src/log-store/src/test_util/log_store_util.rs +++ b/src/log-store/src/test_util/log_store_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use tempdir::TempDir; use crate::fs::config::LogConfig; diff --git a/src/meta-client/Cargo.toml b/src/meta-client/Cargo.toml index bc10eb52e3..1d7301957b 100644 --- a/src/meta-client/Cargo.toml +++ b/src/meta-client/Cargo.toml @@ -2,6 +2,7 @@ name = "meta-client" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] api = { path = "../api" } diff --git a/src/meta-client/examples/meta_client.rs b/src/meta-client/examples/meta_client.rs index 04b3991fdf..6bf23a488d 100644 --- a/src/meta-client/examples/meta_client.rs +++ b/src/meta-client/examples/meta_client.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::time::Duration; use api::v1::meta::{HeartbeatRequest, Peer}; diff --git a/src/meta-client/src/client.rs b/src/meta-client/src/client.rs index be961c8dd5..547bf63870 100644 --- a/src/meta-client/src/client.rs +++ b/src/meta-client/src/client.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod heartbeat; mod load_balance; mod router; diff --git a/src/meta-client/src/client/heartbeat.rs b/src/meta-client/src/client/heartbeat.rs index a4cff3fb16..3c9f5fb44a 100644 --- a/src/meta-client/src/client/heartbeat.rs +++ b/src/meta-client/src/client/heartbeat.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashSet; use std::sync::Arc; diff --git a/src/meta-client/src/client/load_balance.rs b/src/meta-client/src/client/load_balance.rs index 3cf55d18ed..f770056a98 100644 --- a/src/meta-client/src/client/load_balance.rs +++ b/src/meta-client/src/client/load_balance.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use rand::Rng; pub fn random_get(len: usize, func: F) -> Option diff --git a/src/meta-client/src/client/router.rs b/src/meta-client/src/client/router.rs index 5698cf2c41..ec3126f483 100644 --- a/src/meta-client/src/client/router.rs +++ b/src/meta-client/src/client/router.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashSet; use std::sync::Arc; diff --git a/src/meta-client/src/client/store.rs b/src/meta-client/src/client/store.rs index e9cbfd2fb2..400e2fbe4f 100644 --- a/src/meta-client/src/client/store.rs +++ b/src/meta-client/src/client/store.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashSet; use std::sync::Arc; diff --git a/src/meta-client/src/error.rs b/src/meta-client/src/error.rs index 14ddf63615..48252c9d56 100644 --- a/src/meta-client/src/error.rs +++ b/src/meta-client/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_error::prelude::*; #[derive(Debug, Snafu)] diff --git a/src/meta-client/src/lib.rs b/src/meta-client/src/lib.rs index e02c5b9216..459235799c 100644 --- a/src/meta-client/src/lib.rs +++ b/src/meta-client/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use serde::{Deserialize, Serialize}; pub mod client; diff --git a/src/meta-client/src/mocks.rs b/src/meta-client/src/mocks.rs index 99faaebb2f..e0aa7671dd 100644 --- a/src/meta-client/src/mocks.rs +++ b/src/meta-client/src/mocks.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use meta_srv::metasrv::SelectorRef; use meta_srv::mocks as server_mock; use meta_srv::mocks::MockInfo; diff --git a/src/meta-client/src/rpc.rs b/src/meta-client/src/rpc.rs index 2adeb01339..b6f0dc7b5c 100644 --- a/src/meta-client/src/rpc.rs +++ b/src/meta-client/src/rpc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod router; mod store; pub mod util; diff --git a/src/meta-client/src/rpc/router.rs b/src/meta-client/src/rpc/router.rs index c1eb4a8075..03ceeb285f 100644 --- a/src/meta-client/src/rpc/router.rs +++ b/src/meta-client/src/rpc/router.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::meta::{ diff --git a/src/meta-client/src/rpc/store.rs b/src/meta-client/src/rpc/store.rs index 9b878523c7..73fa8e002d 100644 --- a/src/meta-client/src/rpc/store.rs +++ b/src/meta-client/src/rpc/store.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{ BatchPutRequest as PbBatchPutRequest, BatchPutResponse as PbBatchPutResponse, CompareAndPutRequest as PbCompareAndPutRequest, diff --git a/src/meta-client/src/rpc/util.rs b/src/meta-client/src/rpc/util.rs index 7b84d9b81e..58e6bebacb 100644 --- a/src/meta-client/src/rpc/util.rs +++ b/src/meta-client/src/rpc/util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::ResponseHeader; use crate::error; diff --git a/src/meta-srv/Cargo.toml b/src/meta-srv/Cargo.toml index af8a87c861..738ca359fa 100644 --- a/src/meta-srv/Cargo.toml +++ b/src/meta-srv/Cargo.toml @@ -2,6 +2,7 @@ name = "meta-srv" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [features] mock = [] diff --git a/src/meta-srv/examples/kv_store.rs b/src/meta-srv/examples/kv_store.rs index 466cd9c576..3ff3812650 100644 --- a/src/meta-srv/examples/kv_store.rs +++ b/src/meta-srv/examples/kv_store.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{DeleteRangeRequest, PutRequest, RangeRequest}; use meta_srv::service::store::etcd::EtcdStore; use tracing::{event, subscriber, Level}; diff --git a/src/meta-srv/src/bootstrap.rs b/src/meta-srv/src/bootstrap.rs index c3616ee182..db2e269861 100644 --- a/src/meta-srv/src/bootstrap.rs +++ b/src/meta-srv/src/bootstrap.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::heartbeat_server::HeartbeatServer; use api::v1::meta::router_server::RouterServer; use api::v1::meta::store_server::StoreServer; diff --git a/src/meta-srv/src/election.rs b/src/meta-srv/src/election.rs index 09a6e2512a..390d1a12fc 100644 --- a/src/meta-srv/src/election.rs +++ b/src/meta-srv/src/election.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) mod etcd; use crate::error::Result; diff --git a/src/meta-srv/src/election/etcd.rs b/src/meta-srv/src/election/etcd.rs index d1dcf982bb..d2d3e362c4 100644 --- a/src/meta-srv/src/election/etcd.rs +++ b/src/meta-srv/src/election/etcd.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; diff --git a/src/meta-srv/src/error.rs b/src/meta-srv/src/error.rs index 5817a03f72..359547c461 100644 --- a/src/meta-srv/src/error.rs +++ b/src/meta-srv/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_error::prelude::*; use tonic::{Code, Status}; diff --git a/src/meta-srv/src/handler.rs b/src/meta-srv/src/handler.rs index c40dd8ce8d..07d36df6f5 100644 --- a/src/meta-srv/src/handler.rs +++ b/src/meta-srv/src/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub(crate) mod check_leader; pub(crate) mod datanode_lease; pub(crate) mod response_header; diff --git a/src/meta-srv/src/handler/check_leader.rs b/src/meta-srv/src/handler/check_leader.rs index 13bae8cfdd..da93c358ea 100644 --- a/src/meta-srv/src/handler/check_leader.rs +++ b/src/meta-srv/src/handler/check_leader.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{Error, HeartbeatRequest}; use crate::error::Result; diff --git a/src/meta-srv/src/handler/datanode_lease.rs b/src/meta-srv/src/handler/datanode_lease.rs index da33c7d250..ad2467287d 100644 --- a/src/meta-srv/src/handler/datanode_lease.rs +++ b/src/meta-srv/src/handler/datanode_lease.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{HeartbeatRequest, PutRequest}; use common_telemetry::info; use common_time::util as time_util; diff --git a/src/meta-srv/src/handler/response_header.rs b/src/meta-srv/src/handler/response_header.rs index 32ab981f85..97981eb497 100644 --- a/src/meta-srv/src/handler/response_header.rs +++ b/src/meta-srv/src/handler/response_header.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{HeartbeatRequest, ResponseHeader, PROTOCOL_VERSION}; use crate::error::Result; diff --git a/src/meta-srv/src/keys.rs b/src/meta-srv/src/keys.rs index 9b4aff18de..db292042c7 100644 --- a/src/meta-srv/src/keys.rs +++ b/src/meta-srv/src/keys.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::str::FromStr; use api::v1::meta::TableName; diff --git a/src/meta-srv/src/lease.rs b/src/meta-srv/src/lease.rs index f1d64343f1..41a9b77678 100644 --- a/src/meta-srv/src/lease.rs +++ b/src/meta-srv/src/lease.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::RangeRequest; use crate::error::Result; diff --git a/src/meta-srv/src/lib.rs b/src/meta-srv/src/lib.rs index 865d2cb33d..44bf9006b8 100644 --- a/src/meta-srv/src/lib.rs +++ b/src/meta-srv/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(btree_drain_filter)] pub mod bootstrap; mod election; diff --git a/src/meta-srv/src/metasrv.rs b/src/meta-srv/src/metasrv.rs index a21debe78b..e0f2548ce1 100644 --- a/src/meta-srv/src/metasrv.rs +++ b/src/meta-srv/src/metasrv.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; diff --git a/src/meta-srv/src/mocks.rs b/src/meta-srv/src/mocks.rs index 34ac85b95c..05e901ec26 100644 --- a/src/meta-srv/src/mocks.rs +++ b/src/meta-srv/src/mocks.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::meta::heartbeat_server::HeartbeatServer; diff --git a/src/meta-srv/src/selector.rs b/src/meta-srv/src/selector.rs index 1b03960477..34af33808e 100644 --- a/src/meta-srv/src/selector.rs +++ b/src/meta-srv/src/selector.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod lease_based; use crate::error::Result; diff --git a/src/meta-srv/src/selector/lease_based.rs b/src/meta-srv/src/selector/lease_based.rs index bfbd224120..5cc218d1b8 100644 --- a/src/meta-srv/src/selector/lease_based.rs +++ b/src/meta-srv/src/selector/lease_based.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::Peer; use common_time::util as time_util; diff --git a/src/meta-srv/src/sequence.rs b/src/meta-srv/src/sequence.rs index eef3948f03..2737925bbd 100644 --- a/src/meta-srv/src/sequence.rs +++ b/src/meta-srv/src/sequence.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::ops::Range; use std::sync::Arc; diff --git a/src/meta-srv/src/service.rs b/src/meta-srv/src/service.rs index 58dc841e6a..6061d4297a 100644 --- a/src/meta-srv/src/service.rs +++ b/src/meta-srv/src/service.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::pin::Pin; use futures::Stream; diff --git a/src/meta-srv/src/service/admin.rs b/src/meta-srv/src/service/admin.rs index 13e32a6f59..abacfd8872 100644 --- a/src/meta-srv/src/service/admin.rs +++ b/src/meta-srv/src/service/admin.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod health; use std::collections::HashMap; diff --git a/src/meta-srv/src/service/admin/health.rs b/src/meta-srv/src/service/admin/health.rs index 60e7d7310a..7a4649c0e4 100644 --- a/src/meta-srv/src/service/admin/health.rs +++ b/src/meta-srv/src/service/admin/health.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use tonic::codegen::http; diff --git a/src/meta-srv/src/service/heartbeat.rs b/src/meta-srv/src/service/heartbeat.rs index 895a4bb9aa..a71f9cd63f 100644 --- a/src/meta-srv/src/service/heartbeat.rs +++ b/src/meta-srv/src/service/heartbeat.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io::ErrorKind; use std::sync::atomic::{AtomicU64, Ordering}; diff --git a/src/meta-srv/src/service/router.rs b/src/meta-srv/src/service/router.rs index cdb34c3ecc..02e65f8a0b 100644 --- a/src/meta-srv/src/service/router.rs +++ b/src/meta-srv/src/service/router.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::meta::{ router_server, CreateRequest, Error, PeerDict, PutRequest, RangeRequest, Region, RegionRoute, ResponseHeader, RouteRequest, RouteResponse, Table, TableRoute, TableRouteValue, diff --git a/src/meta-srv/src/service/store.rs b/src/meta-srv/src/service/store.rs index beef0408cc..0bb202a9b9 100644 --- a/src/meta-srv/src/service/store.rs +++ b/src/meta-srv/src/service/store.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod etcd; pub mod kv; pub mod memory; diff --git a/src/meta-srv/src/service/store/etcd.rs b/src/meta-srv/src/service/store/etcd.rs index bf1573a7da..ffffabac9b 100644 --- a/src/meta-srv/src/service/store/etcd.rs +++ b/src/meta-srv/src/service/store/etcd.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::meta::{ diff --git a/src/meta-srv/src/service/store/kv.rs b/src/meta-srv/src/service/store/kv.rs index 52bdf072ad..9238422831 100644 --- a/src/meta-srv/src/service/store/kv.rs +++ b/src/meta-srv/src/service/store/kv.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::meta::{ diff --git a/src/meta-srv/src/service/store/memory.rs b/src/meta-srv/src/service/store/memory.rs index 7caf219d25..2e52e2bbe8 100644 --- a/src/meta-srv/src/service/store/memory.rs +++ b/src/meta-srv/src/service/store/memory.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::btree_map::Entry; use std::collections::BTreeMap; use std::ops::Range; diff --git a/src/meta-srv/src/util.rs b/src/meta-srv/src/util.rs index d8b2ec7e60..8fcdfc7e9e 100644 --- a/src/meta-srv/src/util.rs +++ b/src/meta-srv/src/util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Get prefix end key of `key`. #[inline] pub fn get_prefix_end_key(key: &[u8]) -> Vec { diff --git a/src/object-store/Cargo.toml b/src/object-store/Cargo.toml index 8ad3bb1a0a..91e9eb3bb2 100644 --- a/src/object-store/Cargo.toml +++ b/src/object-store/Cargo.toml @@ -2,7 +2,7 @@ name = "object-store" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] futures = { version = "0.3" } diff --git a/src/object-store/src/backend.rs b/src/object-store/src/backend.rs index b28002fe5e..d469c0bb7b 100644 --- a/src/object-store/src/backend.rs +++ b/src/object-store/src/backend.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod azblob; pub mod fs; pub mod memory; diff --git a/src/object-store/src/backend/azblob.rs b/src/object-store/src/backend/azblob.rs index 0296e6ed2c..6a70ef95d3 100644 --- a/src/object-store/src/backend/azblob.rs +++ b/src/object-store/src/backend/azblob.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use opendal::services::azblob::{Backend, Builder}; diff --git a/src/object-store/src/backend/fs.rs b/src/object-store/src/backend/fs.rs index b8f727ed58..78c03a24bb 100644 --- a/src/object-store/src/backend/fs.rs +++ b/src/object-store/src/backend/fs.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use opendal::services::fs::{Backend, Builder}; diff --git a/src/object-store/src/backend/memory.rs b/src/object-store/src/backend/memory.rs index 3a27615e12..7f9e2a4acd 100644 --- a/src/object-store/src/backend/memory.rs +++ b/src/object-store/src/backend/memory.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use opendal::services::memory::{Backend, Builder}; diff --git a/src/object-store/src/backend/s3.rs b/src/object-store/src/backend/s3.rs index 8eec123285..918e84a6b8 100644 --- a/src/object-store/src/backend/s3.rs +++ b/src/object-store/src/backend/s3.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use opendal::services::s3::{Backend, Builder}; diff --git a/src/object-store/src/lib.rs b/src/object-store/src/lib.rs index 83545a4e7d..88702ebf3a 100644 --- a/src/object-store/src/lib.rs +++ b/src/object-store/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use opendal::io_util::SeekableReader; pub use opendal::{ layers, services, Accessor, DirEntry, DirStreamer, Layer, Object, ObjectMetadata, ObjectMode, diff --git a/src/object-store/src/util.rs b/src/object-store/src/util.rs index 32231dca6a..05447f0594 100644 --- a/src/object-store/src/util.rs +++ b/src/object-store/src/util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use futures::TryStreamExt; use crate::{DirEntry, DirStreamer}; diff --git a/src/object-store/tests/object_store_test.rs b/src/object-store/tests/object_store_test.rs index cb229b43a2..2b63ac0487 100644 --- a/src/object-store/tests/object_store_test.rs +++ b/src/object-store/tests/object_store_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::env; use anyhow::Result; diff --git a/src/query/Cargo.toml b/src/query/Cargo.toml index ad1c5a9003..90f562ea11 100644 --- a/src/query/Cargo.toml +++ b/src/query/Cargo.toml @@ -2,6 +2,7 @@ name = "query" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] arc-swap = "1.0" diff --git a/src/query/src/database.rs b/src/query/src/database.rs deleted file mode 100644 index 8b13789179..0000000000 --- a/src/query/src/database.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/query/src/datafusion.rs b/src/query/src/datafusion.rs index ded7e41b2a..caf8fce156 100644 --- a/src/query/src/datafusion.rs +++ b/src/query/src/datafusion.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Planner, QueryEngine implementations based on DataFusion. mod catalog_adapter; diff --git a/src/query/src/datafusion/catalog_adapter.rs b/src/query/src/datafusion/catalog_adapter.rs index 220b5f0c7a..f21cf4406e 100644 --- a/src/query/src/datafusion/catalog_adapter.rs +++ b/src/query/src/datafusion/catalog_adapter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Catalog adapter between datafusion and greptime query engine. use std::any::Any; diff --git a/src/query/src/datafusion/error.rs b/src/query/src/datafusion/error.rs index c631eb36ec..b7bb5d9919 100644 --- a/src/query/src/datafusion/error.rs +++ b/src/query/src/datafusion/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/query/src/datafusion/planner.rs b/src/query/src/datafusion/planner.rs index 5cbed99d3f..8d1acb725c 100644 --- a/src/query/src/datafusion/planner.rs +++ b/src/query/src/datafusion/planner.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use arrow::datatypes::DataType; diff --git a/src/query/src/error.rs b/src/query/src/error.rs index 2e55380640..47257b1771 100644 --- a/src/query/src/error.rs +++ b/src/query/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/query/src/executor.rs b/src/query/src/executor.rs index 0d0e45c304..46eeaf97fa 100644 --- a/src/query/src/executor.rs +++ b/src/query/src/executor.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_query::physical_plan::PhysicalPlan; diff --git a/src/query/src/expr.rs b/src/query/src/expr.rs index 8b13789179..d1be7904f6 100644 --- a/src/query/src/expr.rs +++ b/src/query/src/expr.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + diff --git a/src/query/src/function.rs b/src/query/src/function.rs index b5687bf4b4..0171061277 100644 --- a/src/query/src/function.rs +++ b/src/query/src/function.rs @@ -1 +1,15 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! GreptimeDB builtin functions diff --git a/src/query/src/lib.rs b/src/query/src/lib.rs index 717f01c73f..14aa4f773c 100644 --- a/src/query/src/lib.rs +++ b/src/query/src/lib.rs @@ -1,4 +1,17 @@ -pub mod database; +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod datafusion; pub mod error; pub mod executor; diff --git a/src/query/src/logical_optimizer.rs b/src/query/src/logical_optimizer.rs index 8b4414fd95..8c35f856a5 100644 --- a/src/query/src/logical_optimizer.rs +++ b/src/query/src/logical_optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::error::Result; use crate::plan::LogicalPlan; use crate::query_engine::QueryContext; diff --git a/src/query/src/metric.rs b/src/query/src/metric.rs index 1c843f7ee7..7f927098f6 100644 --- a/src/query/src/metric.rs +++ b/src/query/src/metric.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! query engine metrics pub static METRIC_PARSE_SQL_ELAPSED: &str = "query.parse_sql_elapsed"; diff --git a/src/query/src/optimizer.rs b/src/query/src/optimizer.rs index 9bd012af96..33adbdef70 100644 --- a/src/query/src/optimizer.rs +++ b/src/query/src/optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::str::FromStr; use std::sync::Arc; diff --git a/src/query/src/physical_optimizer.rs b/src/query/src/physical_optimizer.rs index 65bff044ea..c96d27a7f7 100644 --- a/src/query/src/physical_optimizer.rs +++ b/src/query/src/physical_optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_query::physical_plan::PhysicalPlan; diff --git a/src/query/src/physical_planner.rs b/src/query/src/physical_planner.rs index 6c8ab6c7b3..2118f1cc82 100644 --- a/src/query/src/physical_planner.rs +++ b/src/query/src/physical_planner.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_query::physical_plan::PhysicalPlan; diff --git a/src/query/src/plan.rs b/src/query/src/plan.rs index c881bdcb5a..c7e337c0e9 100644 --- a/src/query/src/plan.rs +++ b/src/query/src/plan.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::Debug; use datafusion::logical_plan::LogicalPlan as DfLogicalPlan; diff --git a/src/query/src/planner.rs b/src/query/src/planner.rs index 413f138335..8bf3468e04 100644 --- a/src/query/src/planner.rs +++ b/src/query/src/planner.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sql::statements::statement::Statement; use crate::error::Result; diff --git a/src/query/src/query_engine.rs b/src/query/src/query_engine.rs index afbfe91e3f..36d2c54d1a 100644 --- a/src/query/src/query_engine.rs +++ b/src/query/src/query_engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod context; mod state; diff --git a/src/query/src/query_engine/context.rs b/src/query/src/query_engine/context.rs index 6606b65048..c5b5d20c2d 100644 --- a/src/query/src/query_engine/context.rs +++ b/src/query/src/query_engine/context.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /// Query engine execution context use crate::query_engine::state::QueryEngineState; diff --git a/src/query/src/query_engine/state.rs b/src/query/src/query_engine/state.rs index a1d50a7cf8..36bd331b36 100644 --- a/src/query/src/query_engine/state.rs +++ b/src/query/src/query_engine/state.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::fmt; use std::sync::{Arc, RwLock}; diff --git a/src/query/src/sql.rs b/src/query/src/sql.rs index 0d355a9f49..8497e4b0a7 100644 --- a/src/query/src/sql.rs +++ b/src/query/src/sql.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use catalog::CatalogManagerRef; diff --git a/src/query/tests/argmax_test.rs b/src/query/tests/argmax_test.rs index fb9192ef1f..23ff4785ac 100644 --- a/src/query/tests/argmax_test.rs +++ b/src/query/tests/argmax_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; use common_query::Output; diff --git a/src/query/tests/argmin_test.rs b/src/query/tests/argmin_test.rs index d4b025d0ff..0e02f9e4a2 100644 --- a/src/query/tests/argmin_test.rs +++ b/src/query/tests/argmin_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; diff --git a/src/query/tests/function.rs b/src/query/tests/function.rs index 895e7cf5d5..f5ecba91ee 100644 --- a/src/query/tests/function.rs +++ b/src/query/tests/function.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use catalog::local::{MemoryCatalogManager, MemoryCatalogProvider, MemorySchemaProvider}; diff --git a/src/query/tests/mean_test.rs b/src/query/tests/mean_test.rs index f43f2cd8a9..1b068f2456 100644 --- a/src/query/tests/mean_test.rs +++ b/src/query/tests/mean_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; diff --git a/src/query/tests/my_sum_udaf_example.rs b/src/query/tests/my_sum_udaf_example.rs index b3ccb2a489..dbd0427752 100644 --- a/src/query/tests/my_sum_udaf_example.rs +++ b/src/query/tests/my_sum_udaf_example.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::Debug; use std::marker::PhantomData; use std::sync::Arc; diff --git a/src/query/tests/percentile_test.rs b/src/query/tests/percentile_test.rs index 1ef674705e..c504da231a 100644 --- a/src/query/tests/percentile_test.rs +++ b/src/query/tests/percentile_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; use catalog::local::{MemoryCatalogManager, MemoryCatalogProvider, MemorySchemaProvider}; diff --git a/src/query/tests/polyval_test.rs b/src/query/tests/polyval_test.rs index 5b37849dc3..55285e20e1 100644 --- a/src/query/tests/polyval_test.rs +++ b/src/query/tests/polyval_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; diff --git a/src/query/tests/pow.rs b/src/query/tests/pow.rs index 09af588d49..4d9006ca29 100644 --- a/src/query/tests/pow.rs +++ b/src/query/tests/pow.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_query::error::Result; diff --git a/src/query/tests/query_engine_test.rs b/src/query/tests/query_engine_test.rs index 1a515158e8..291c31057f 100644 --- a/src/query/tests/query_engine_test.rs +++ b/src/query/tests/query_engine_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod pow; use std::sync::Arc; diff --git a/src/query/tests/scipy_stats_norm_cdf_test.rs b/src/query/tests/scipy_stats_norm_cdf_test.rs index ae531527e5..572a433683 100644 --- a/src/query/tests/scipy_stats_norm_cdf_test.rs +++ b/src/query/tests/scipy_stats_norm_cdf_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; diff --git a/src/query/tests/scipy_stats_norm_pdf.rs b/src/query/tests/scipy_stats_norm_pdf.rs index b744f38afa..efbf0ddec3 100644 --- a/src/query/tests/scipy_stats_norm_pdf.rs +++ b/src/query/tests/scipy_stats_norm_pdf.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; mod function; diff --git a/src/script/Cargo.toml b/src/script/Cargo.toml index 83e350a0c2..b894736c3d 100644 --- a/src/script/Cargo.toml +++ b/src/script/Cargo.toml @@ -2,6 +2,7 @@ edition = "2021" name = "script" version = "0.1.0" +license = "Apache-2.0" [features] default = ["python"] @@ -15,7 +16,7 @@ python = [ "dep:rustpython-compiler-core", "dep:rustpython-bytecode", "dep:rustpython-ast", - "dep:paste" + "dep:paste", ] [dependencies] @@ -43,7 +44,10 @@ rustpython-bytecode = { git = "https://github.com/RustPython/RustPython", option rustpython-compiler = { git = "https://github.com/RustPython/RustPython", optional = true, rev = "02a1d1d" } rustpython-compiler-core = { git = "https://github.com/RustPython/RustPython", optional = true, rev = "02a1d1d" } rustpython-parser = { git = "https://github.com/RustPython/RustPython", optional = true, rev = "02a1d1d" } -rustpython-vm = { git = "https://github.com/RustPython/RustPython", optional = true, rev = "02a1d1d", features = ["default", "freeze-stdlib"] } +rustpython-vm = { git = "https://github.com/RustPython/RustPython", optional = true, rev = "02a1d1d", features = [ + "default", + "freeze-stdlib", +] } snafu = { version = "0.7", features = ["backtraces"] } sql = { path = "../sql" } table = { path = "../table" } diff --git a/src/script/src/engine.rs b/src/script/src/engine.rs index 92037ae5c1..c9cbd9764a 100644 --- a/src/script/src/engine.rs +++ b/src/script/src/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Script engine use std::any::Any; diff --git a/src/script/src/error.rs b/src/script/src/error.rs index 79e640358d..60e06647a1 100644 --- a/src/script/src/error.rs +++ b/src/script/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::ErrorExt; diff --git a/src/script/src/lib.rs b/src/script/src/lib.rs index 3dbb7ab74b..43db30b5d4 100644 --- a/src/script/src/lib.rs +++ b/src/script/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(iterator_try_reduce)] pub mod engine; pub mod error; diff --git a/src/script/src/manager.rs b/src/script/src/manager.rs index d1ed208c6d..be98255870 100644 --- a/src/script/src/manager.rs +++ b/src/script/src/manager.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Scripts manager use std::collections::HashMap; use std::sync::{Arc, RwLock}; diff --git a/src/script/src/python.rs b/src/script/src/python.rs index 05f7fc3374..5fb65828be 100644 --- a/src/script/src/python.rs +++ b/src/script/src/python.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Python script coprocessor mod builtins; diff --git a/src/script/src/python/builtins/mod.rs b/src/script/src/python/builtins/mod.rs index a7b03485dd..ef85d088fe 100644 --- a/src/script/src/python/builtins/mod.rs +++ b/src/script/src/python/builtins/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Builtin module contains GreptimeDB builtin udf/udaf #[cfg(test)] diff --git a/src/script/src/python/builtins/test.rs b/src/script/src/python/builtins/test.rs index 50618cd035..82c80e4a29 100644 --- a/src/script/src/python/builtins/test.rs +++ b/src/script/src/python/builtins/test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::fs::File; use std::io::Read; diff --git a/src/script/src/python/coprocessor.rs b/src/script/src/python/coprocessor.rs index 39e527d3c4..483ecfe2f8 100644 --- a/src/script/src/python/coprocessor.rs +++ b/src/script/src/python/coprocessor.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod compile; pub mod parse; diff --git a/src/script/src/python/coprocessor/compile.rs b/src/script/src/python/coprocessor/compile.rs index 151a0dbd88..5bef63dc23 100644 --- a/src/script/src/python/coprocessor/compile.rs +++ b/src/script/src/python/coprocessor/compile.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! compile script to code object use rustpython_bytecode::CodeObject; diff --git a/src/script/src/python/coprocessor/parse.rs b/src/script/src/python/coprocessor/parse.rs index f329a002e2..51423c9bc5 100644 --- a/src/script/src/python/coprocessor/parse.rs +++ b/src/script/src/python/coprocessor/parse.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashSet; use datatypes::arrow::datatypes::DataType; diff --git a/src/script/src/python/engine.rs b/src/script/src/python/engine.rs index 1f52a541c9..7a6c02c858 100644 --- a/src/script/src/python/engine.rs +++ b/src/script/src/python/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Python script engine use std::any::Any; use std::pin::Pin; diff --git a/src/script/src/python/error.rs b/src/script/src/python/error.rs index 8c418af44d..4fe9a717bf 100644 --- a/src/script/src/python/error.rs +++ b/src/script/src/python/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_error::prelude::{ErrorCompat, ErrorExt, StatusCode}; use console::{style, Style}; use datafusion::error::DataFusionError; diff --git a/src/script/src/python/test.rs b/src/script/src/python/test.rs index 6cca4eb7b6..043dcba898 100644 --- a/src/script/src/python/test.rs +++ b/src/script/src/python/test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(clippy::print_stdout, clippy::print_stderr)] // for debug purpose, also this is already a // test module so allow print_stdout shouldn't be a problem? diff --git a/src/script/src/python/utils.rs b/src/script/src/python/utils.rs index 5e4415ea3e..fcc0bf3956 100644 --- a/src/script/src/python/utils.rs +++ b/src/script/src/python/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datafusion::arrow::array::{ArrayRef, BooleanArray, NullArray, PrimitiveArray, Utf8Array}; diff --git a/src/script/src/python/vector.rs b/src/script/src/python/vector.rs index 021b51ddbc..1ca3d45097 100644 --- a/src/script/src/python/vector.rs +++ b/src/script/src/python/vector.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::ops::Deref; use std::sync::Arc; diff --git a/src/script/src/table.rs b/src/script/src/table.rs index fa5b4b4624..6eac358244 100644 --- a/src/script/src/table.rs +++ b/src/script/src/table.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Scripts table use std::collections::HashMap; use std::sync::Arc; diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 1b4654c8b3..baf8845bd7 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -2,6 +2,7 @@ name = "servers" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] aide = { version = "0.6", features = ["axum"] } diff --git a/src/servers/src/context.rs b/src/servers/src/context.rs index 5599e1a8e4..bf29b83841 100644 --- a/src/servers/src/context.rs +++ b/src/servers/src/context.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc; diff --git a/src/servers/src/error.rs b/src/servers/src/error.rs index 51fc7e73f7..62b3d7a814 100644 --- a/src/servers/src/error.rs +++ b/src/servers/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::net::SocketAddr; diff --git a/src/servers/src/grpc.rs b/src/servers/src/grpc.rs index 97588f5292..5d56ddd36b 100644 --- a/src/servers/src/grpc.rs +++ b/src/servers/src/grpc.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod handler; use std::net::SocketAddr; diff --git a/src/servers/src/grpc/handler.rs b/src/servers/src/grpc/handler.rs index 3b96de603f..8ee4ce88ae 100644 --- a/src/servers/src/grpc/handler.rs +++ b/src/servers/src/grpc/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::{AdminResponse, BatchRequest, BatchResponse, DatabaseResponse}; diff --git a/src/servers/src/http.rs b/src/servers/src/http.rs index fc913ce286..42e837c9ca 100644 --- a/src/servers/src/http.rs +++ b/src/servers/src/http.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod context; pub mod handler; pub mod influxdb; diff --git a/src/servers/src/http/context.rs b/src/servers/src/http/context.rs index 8a2050a1a1..81b072d454 100644 --- a/src/servers/src/http/context.rs +++ b/src/servers/src/http/context.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use axum::http; use axum::http::{Request, StatusCode}; use axum::middleware::Next; diff --git a/src/servers/src/http/handler.rs b/src/servers/src/http/handler.rs index e819b5b8bf..69b41edd1b 100644 --- a/src/servers/src/http/handler.rs +++ b/src/servers/src/http/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::time::Instant; diff --git a/src/servers/src/http/influxdb.rs b/src/servers/src/http/influxdb.rs index 5b8695e226..06929eb341 100644 --- a/src/servers/src/http/influxdb.rs +++ b/src/servers/src/http/influxdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use axum::extract::{Query, State}; diff --git a/src/servers/src/http/opentsdb.rs b/src/servers/src/http/opentsdb.rs index 216077827a..d47e26b441 100644 --- a/src/servers/src/http/opentsdb.rs +++ b/src/servers/src/http/opentsdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use axum::extract::{Query, RawBody, State}; diff --git a/src/servers/src/http/prometheus.rs b/src/servers/src/http/prometheus.rs index 02a62973e7..6b37d23fc2 100644 --- a/src/servers/src/http/prometheus.rs +++ b/src/servers/src/http/prometheus.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::prometheus::remote::{ReadRequest, WriteRequest}; use axum::extract::{Query, RawBody, State}; use axum::http::{header, StatusCode}; diff --git a/src/servers/src/http/script.rs b/src/servers/src/http/script.rs index e1319bf242..5b9e17b600 100644 --- a/src/servers/src/http/script.rs +++ b/src/servers/src/http/script.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::time::Instant; use axum::extract::{Json, Query, RawBody, State}; diff --git a/src/servers/src/influxdb.rs b/src/servers/src/influxdb.rs index c8e755600c..df1835efcd 100644 --- a/src/servers/src/influxdb.rs +++ b/src/servers/src/influxdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::insert_expr::{self, Expr}; diff --git a/src/servers/src/lib.rs b/src/servers/src/lib.rs index d7ad934502..88579e2daf 100644 --- a/src/servers/src/lib.rs +++ b/src/servers/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] pub mod context; diff --git a/src/servers/src/line_writer.rs b/src/servers/src/line_writer.rs index e11ede723c..cbb2aff987 100644 --- a/src/servers/src/line_writer.rs +++ b/src/servers/src/line_writer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use common_catalog::consts::DEFAULT_CATALOG_NAME; diff --git a/src/servers/src/mysql/federated.rs b/src/servers/src/mysql/federated.rs index 0ae9fc2ba5..8aa3f369fe 100644 --- a/src/servers/src/mysql/federated.rs +++ b/src/servers/src/mysql/federated.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Use regex to filter out some MySQL federated components' emitted statements. //! Inspired by Databend's "[mysql_federated.rs](https://github.com/datafuselabs/databend/blob/ac706bf65845e6895141c96c0a10bad6fdc2d367/src/query/service/src/servers/mysql/mysql_federated.rs)". diff --git a/src/servers/src/mysql/handler.rs b/src/servers/src/mysql/handler.rs index d200e306d8..ce77d952cc 100644 --- a/src/servers/src/mysql/handler.rs +++ b/src/servers/src/mysql/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io; use std::sync::Arc; diff --git a/src/servers/src/mysql/mod.rs b/src/servers/src/mysql/mod.rs index d1df54151c..f22f169a1c 100644 --- a/src/servers/src/mysql/mod.rs +++ b/src/servers/src/mysql/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod federated; pub mod handler; pub mod server; diff --git a/src/servers/src/mysql/server.rs b/src/servers/src/mysql/server.rs index 03159f3181..e8064d20f1 100644 --- a/src/servers/src/mysql/server.rs +++ b/src/servers/src/mysql/server.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::future::Future; use std::net::SocketAddr; use std::sync::Arc; diff --git a/src/servers/src/mysql/writer.rs b/src/servers/src/mysql/writer.rs index f34afa765b..66e4278687 100644 --- a/src/servers/src/mysql/writer.rs +++ b/src/servers/src/mysql/writer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io; use std::ops::Deref; diff --git a/src/servers/src/opentsdb.rs b/src/servers/src/opentsdb.rs index 9129a2c669..dbe0fb601a 100644 --- a/src/servers/src/opentsdb.rs +++ b/src/servers/src/opentsdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod codec; pub mod connection; mod handler; diff --git a/src/servers/src/opentsdb/codec.rs b/src/servers/src/opentsdb/codec.rs index 7871f7e057..2253fd7e63 100644 --- a/src/servers/src/opentsdb/codec.rs +++ b/src/servers/src/opentsdb/codec.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use api::v1::codec::InsertBatch; diff --git a/src/servers/src/opentsdb/connection.rs b/src/servers/src/opentsdb/connection.rs index 3ef2b099e0..a1657259fc 100644 --- a/src/servers/src/opentsdb/connection.rs +++ b/src/servers/src/opentsdb/connection.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Modified from Tokio's mini-redis example. use bytes::{Buf, BytesMut}; diff --git a/src/servers/src/opentsdb/handler.rs b/src/servers/src/opentsdb/handler.rs index 280315cac4..471b784edc 100644 --- a/src/servers/src/opentsdb/handler.rs +++ b/src/servers/src/opentsdb/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Modified from Tokio's mini-redis example. use tokio::io::{AsyncRead, AsyncWrite}; diff --git a/src/servers/src/postgres/auth_handler.rs b/src/servers/src/postgres/auth_handler.rs index 6e279d5911..c17053bfa1 100644 --- a/src/servers/src/postgres/auth_handler.rs +++ b/src/servers/src/postgres/auth_handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::fmt::Debug; diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index 88d86a3865..59c6cc2ea8 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::ops::Deref; use async_trait::async_trait; diff --git a/src/servers/src/postgres/mod.rs b/src/servers/src/postgres/mod.rs index fe38358555..46a02e7fc1 100644 --- a/src/servers/src/postgres/mod.rs +++ b/src/servers/src/postgres/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod auth_handler; mod handler; mod server; diff --git a/src/servers/src/postgres/server.rs b/src/servers/src/postgres/server.rs index 024ae154f2..61adc65d63 100644 --- a/src/servers/src/postgres/server.rs +++ b/src/servers/src/postgres/server.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::future::Future; use std::net::SocketAddr; use std::sync::Arc; diff --git a/src/servers/src/prometheus.rs b/src/servers/src/prometheus.rs index 4852018692..7e18b1d29a 100644 --- a/src/servers/src/prometheus.rs +++ b/src/servers/src/prometheus.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! promethues protcol supportings use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap}; diff --git a/src/servers/src/query_handler.rs b/src/servers/src/query_handler.rs index ec9f87dbbf..ff76bebdc5 100644 --- a/src/servers/src/query_handler.rs +++ b/src/servers/src/query_handler.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::prometheus::remote::{ReadRequest, WriteRequest}; diff --git a/src/servers/src/server.rs b/src/servers/src/server.rs index d4927a1e73..7f4fd4919b 100644 --- a/src/servers/src/server.rs +++ b/src/servers/src/server.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::net::SocketAddr; use std::sync::Arc; diff --git a/src/servers/src/shutdown.rs b/src/servers/src/shutdown.rs index 6ae90c7de9..f31810ef04 100644 --- a/src/servers/src/shutdown.rs +++ b/src/servers/src/shutdown.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Copied from tokio's mini-redis example. use tokio::sync::broadcast; diff --git a/src/servers/tests/http/http_handler_test.rs b/src/servers/tests/http/http_handler_test.rs index 1420967184..ddec8eca54 100644 --- a/src/servers/tests/http/http_handler_test.rs +++ b/src/servers/tests/http/http_handler_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use axum::body::Body; diff --git a/src/servers/tests/http/influxdb_test.rs b/src/servers/tests/http/influxdb_test.rs index a0caac34f0..24a21716cf 100644 --- a/src/servers/tests/http/influxdb_test.rs +++ b/src/servers/tests/http/influxdb_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::v1::InsertExpr; diff --git a/src/servers/tests/http/mod.rs b/src/servers/tests/http/mod.rs index 12c71e5d47..3ffba21daa 100644 --- a/src/servers/tests/http/mod.rs +++ b/src/servers/tests/http/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod http_handler_test; mod influxdb_test; mod opentsdb_test; diff --git a/src/servers/tests/http/opentsdb_test.rs b/src/servers/tests/http/opentsdb_test.rs index 4e83dc3491..f66281302e 100644 --- a/src/servers/tests/http/opentsdb_test.rs +++ b/src/servers/tests/http/opentsdb_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use async_trait::async_trait; diff --git a/src/servers/tests/http/prometheus_test.rs b/src/servers/tests/http/prometheus_test.rs index 05c26623db..a5a3274dc5 100644 --- a/src/servers/tests/http/prometheus_test.rs +++ b/src/servers/tests/http/prometheus_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use api::prometheus::remote::{ diff --git a/src/servers/tests/mod.rs b/src/servers/tests/mod.rs index 4b27848bee..a5663dddd1 100644 --- a/src/servers/tests/mod.rs +++ b/src/servers/tests/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::{Arc, RwLock}; diff --git a/src/servers/tests/mysql/mod.rs b/src/servers/tests/mysql/mod.rs index 7f69ec38d0..aba8699087 100644 --- a/src/servers/tests/mysql/mod.rs +++ b/src/servers/tests/mysql/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datatypes::prelude::*; diff --git a/src/servers/tests/mysql/mysql_server_test.rs b/src/servers/tests/mysql/mysql_server_test.rs index 1c3f365d8a..ce351fce6b 100644 --- a/src/servers/tests/mysql/mysql_server_test.rs +++ b/src/servers/tests/mysql/mysql_server_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::net::SocketAddr; use std::sync::Arc; use std::time::Duration; diff --git a/src/servers/tests/mysql/mysql_writer_test.rs b/src/servers/tests/mysql/mysql_writer_test.rs index 392711b425..9d9d1060c8 100644 --- a/src/servers/tests/mysql/mysql_writer_test.rs +++ b/src/servers/tests/mysql/mysql_writer_test.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datatypes::prelude::*; diff --git a/src/servers/tests/opentsdb.rs b/src/servers/tests/opentsdb.rs index 3caed762d0..12c08ec89a 100644 --- a/src/servers/tests/opentsdb.rs +++ b/src/servers/tests/opentsdb.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::net::SocketAddr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; diff --git a/src/servers/tests/postgres/mod.rs b/src/servers/tests/postgres/mod.rs index 8789b5e4e4..bbbe88ee78 100644 --- a/src/servers/tests/postgres/mod.rs +++ b/src/servers/tests/postgres/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::net::SocketAddr; use std::sync::Arc; use std::time::Duration; diff --git a/src/sql/Cargo.toml b/src/sql/Cargo.toml index c2a1697a86..457bb98877 100644 --- a/src/sql/Cargo.toml +++ b/src/sql/Cargo.toml @@ -2,7 +2,7 @@ name = "sql" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] api = { path = "../api" } diff --git a/src/sql/src/ast.rs b/src/sql/src/ast.rs index bd28b1fcb4..11636df8c0 100644 --- a/src/sql/src/ast.rs +++ b/src/sql/src/ast.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub use sqlparser::ast::{ ColumnDef, ColumnOption, ColumnOptionDef, DataType, Expr, Function, FunctionArg, FunctionArgExpr, Ident, ObjectName, SqlOption, TableConstraint, Value, diff --git a/src/sql/src/dialect.rs b/src/sql/src/dialect.rs index 20e141877c..534f438c99 100644 --- a/src/sql/src/dialect.rs +++ b/src/sql/src/dialect.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // todo(hl) wrap sqlparser dialects pub use sqlparser::dialect::{Dialect, GenericDialect}; diff --git a/src/sql/src/error.rs b/src/sql/src/error.rs index 26c5dd741c..a607a42738 100644 --- a/src/sql/src/error.rs +++ b/src/sql/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/sql/src/lib.rs b/src/sql/src/lib.rs index 630a26a1ef..331496586a 100644 --- a/src/sql/src/lib.rs +++ b/src/sql/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![feature(assert_matches)] pub mod ast; diff --git a/src/sql/src/parser.rs b/src/sql/src/parser.rs index 5eceb83e4a..796f9816af 100644 --- a/src/sql/src/parser.rs +++ b/src/sql/src/parser.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use snafu::{ensure, ResultExt}; use sqlparser::dialect::Dialect; use sqlparser::keywords::Keyword; diff --git a/src/sql/src/parsers.rs b/src/sql/src/parsers.rs index e32ee1e6c3..8feaa50204 100644 --- a/src/sql/src/parsers.rs +++ b/src/sql/src/parsers.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod alter_parser; pub(crate) mod create_parser; pub(crate) mod insert_parser; diff --git a/src/sql/src/parsers/alter_parser.rs b/src/sql/src/parsers/alter_parser.rs index 283dc2eea3..08661e1c16 100644 --- a/src/sql/src/parsers/alter_parser.rs +++ b/src/sql/src/parsers/alter_parser.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use snafu::ResultExt; use sqlparser::keywords::Keyword; use sqlparser::parser::ParserError; diff --git a/src/sql/src/parsers/create_parser.rs b/src/sql/src/parsers/create_parser.rs index e99bc52ba3..af52f12603 100644 --- a/src/sql/src/parsers/create_parser.rs +++ b/src/sql/src/parsers/create_parser.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use itertools::Itertools; diff --git a/src/sql/src/parsers/insert_parser.rs b/src/sql/src/parsers/insert_parser.rs index 6d6800d836..43709407ad 100644 --- a/src/sql/src/parsers/insert_parser.rs +++ b/src/sql/src/parsers/insert_parser.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use snafu::ResultExt; use sqlparser::ast::Statement as SpStatement; diff --git a/src/sql/src/parsers/query_parser.rs b/src/sql/src/parsers/query_parser.rs index 603d603272..e75642c79a 100644 --- a/src/sql/src/parsers/query_parser.rs +++ b/src/sql/src/parsers/query_parser.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use snafu::prelude::*; use crate::error::{self, Result}; diff --git a/src/sql/src/statements.rs b/src/sql/src/statements.rs index 229323b259..9d24b5ebf0 100644 --- a/src/sql/src/statements.rs +++ b/src/sql/src/statements.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod alter; pub mod create; pub mod insert; diff --git a/src/sql/src/statements/alter.rs b/src/sql/src/statements/alter.rs index 8861fc0298..a9dfaad8d9 100644 --- a/src/sql/src/statements/alter.rs +++ b/src/sql/src/statements/alter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use api::v1::{alter_expr, AddColumn, AlterExpr}; use sqlparser::ast::{ColumnDef, ObjectName, TableConstraint}; diff --git a/src/sql/src/statements/create.rs b/src/sql/src/statements/create.rs index 41d9ef92fc..01a7cb28cb 100644 --- a/src/sql/src/statements/create.rs +++ b/src/sql/src/statements/create.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::ast::{ColumnDef, Ident, ObjectName, SqlOption, TableConstraint, Value as SqlValue}; /// Time index name, used in table constraints. diff --git a/src/sql/src/statements/insert.rs b/src/sql/src/statements/insert.rs index 89e88da221..e94e512d15 100644 --- a/src/sql/src/statements/insert.rs +++ b/src/sql/src/statements/insert.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sqlparser::ast::{SetExpr, Statement, UnaryOperator, Values}; use sqlparser::parser::ParserError; diff --git a/src/sql/src/statements/query.rs b/src/sql/src/statements/query.rs index 451b6eb64d..64e115f135 100644 --- a/src/sql/src/statements/query.rs +++ b/src/sql/src/statements/query.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sqlparser::ast::Query as SpQuery; use crate::error::Error; diff --git a/src/sql/src/statements/show.rs b/src/sql/src/statements/show.rs index ae0f348a72..29b6d38baf 100644 --- a/src/sql/src/statements/show.rs +++ b/src/sql/src/statements/show.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt; use crate::ast::{Expr, Ident}; diff --git a/src/sql/src/statements/statement.rs b/src/sql/src/statements/statement.rs index 0d1582845b..c4235be07c 100644 --- a/src/sql/src/statements/statement.rs +++ b/src/sql/src/statements/statement.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sqlparser::ast::Statement as SpStatement; use sqlparser::parser::ParserError; diff --git a/src/sql/src/statements/statement_query.rs b/src/sql/src/statements/statement_query.rs index ec4315b91a..2d530f10d3 100644 --- a/src/sql/src/statements/statement_query.rs +++ b/src/sql/src/statements/statement_query.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use sqlparser::ast::Query as SpQuery; use crate::errors::ParserError; diff --git a/src/storage/Cargo.toml b/src/storage/Cargo.toml index ccc0a48d0a..94d106f699 100644 --- a/src/storage/Cargo.toml +++ b/src/storage/Cargo.toml @@ -2,7 +2,7 @@ name = "storage" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] arc-swap = "1.0" diff --git a/src/storage/benches/bench_main.rs b/src/storage/benches/bench_main.rs index cdaa4eec90..3590d8de03 100644 --- a/src/storage/benches/bench_main.rs +++ b/src/storage/benches/bench_main.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::criterion_main; mod memtable; diff --git a/src/storage/benches/memtable/bench_memtable_read.rs b/src/storage/benches/memtable/bench_memtable_read.rs index 9a75224534..4ca030f50e 100644 --- a/src/storage/benches/memtable/bench_memtable_read.rs +++ b/src/storage/benches/memtable/bench_memtable_read.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::{criterion_group, criterion_main, Criterion, Throughput}; use crate::memtable::generate_kvs; diff --git a/src/storage/benches/memtable/bench_memtable_read_write_ratio.rs b/src/storage/benches/memtable/bench_memtable_read_write_ratio.rs index 417e62e171..d9757b8471 100644 --- a/src/storage/benches/memtable/bench_memtable_read_write_ratio.rs +++ b/src/storage/benches/memtable/bench_memtable_read_write_ratio.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::Arc; use std::thread; diff --git a/src/storage/benches/memtable/bench_memtable_write.rs b/src/storage/benches/memtable/bench_memtable_write.rs index 4a5a2ecd5c..39fc1bbde7 100644 --- a/src/storage/benches/memtable/bench_memtable_write.rs +++ b/src/storage/benches/memtable/bench_memtable_write.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::{criterion_group, criterion_main, Criterion, Throughput}; use crate::memtable::generate_kvs; diff --git a/src/storage/benches/memtable/mod.rs b/src/storage/benches/memtable/mod.rs index 1582a76baa..462c3edc28 100644 --- a/src/storage/benches/memtable/mod.rs +++ b/src/storage/benches/memtable/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod bench_memtable_read; pub mod bench_memtable_read_write_ratio; pub mod bench_memtable_write; diff --git a/src/storage/benches/memtable/util/bench_context.rs b/src/storage/benches/memtable/util/bench_context.rs index 2d682ec1b3..6d36f5abdd 100644 --- a/src/storage/benches/memtable/util/bench_context.rs +++ b/src/storage/benches/memtable/util/bench_context.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use storage::memtable::{IterContext, KeyValues, MemtableRef}; use crate::memtable::util::new_memtable; diff --git a/src/storage/benches/memtable/util/mod.rs b/src/storage/benches/memtable/util/mod.rs index 410a935ee8..62b3ee8c3d 100644 --- a/src/storage/benches/memtable/util/mod.rs +++ b/src/storage/benches/memtable/util/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod bench_context; pub mod regiondesc_util; pub mod schema_util; diff --git a/src/storage/benches/memtable/util/regiondesc_util.rs b/src/storage/benches/memtable/util/regiondesc_util.rs index 82ace38012..51dcb8795a 100644 --- a/src/storage/benches/memtable/util/regiondesc_util.rs +++ b/src/storage/benches/memtable/util/regiondesc_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::prelude::ConcreteDataType; use store_api::storage::{ ColumnDescriptor, ColumnDescriptorBuilder, ColumnFamilyDescriptorBuilder, ColumnId, diff --git a/src/storage/benches/memtable/util/schema_util.rs b/src/storage/benches/memtable/util/schema_util.rs index 04e15a1591..0522bae825 100644 --- a/src/storage/benches/memtable/util/schema_util.rs +++ b/src/storage/benches/memtable/util/schema_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datatypes::prelude::*; diff --git a/src/storage/benches/wal/bench_decode.rs b/src/storage/benches/wal/bench_decode.rs index 5b4abb8815..f451407e97 100644 --- a/src/storage/benches/wal/bench_decode.rs +++ b/src/storage/benches/wal/bench_decode.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::{criterion_group, criterion_main, Criterion}; use storage::codec::{Decoder, Encoder}; use storage::write_batch::{codec, WriteBatch}; diff --git a/src/storage/benches/wal/bench_encode.rs b/src/storage/benches/wal/bench_encode.rs index 040b8e326a..1abc46002f 100644 --- a/src/storage/benches/wal/bench_encode.rs +++ b/src/storage/benches/wal/bench_encode.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::{criterion_group, criterion_main, Criterion}; use storage::codec::Encoder; use storage::write_batch::{codec, WriteBatch}; diff --git a/src/storage/benches/wal/bench_wal.rs b/src/storage/benches/wal/bench_wal.rs index e0cca5ed86..67e76f2527 100644 --- a/src/storage/benches/wal/bench_wal.rs +++ b/src/storage/benches/wal/bench_wal.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use criterion::{criterion_group, criterion_main, Criterion}; use storage::codec::{Decoder, Encoder}; use storage::write_batch::{codec, WriteBatch}; diff --git a/src/storage/benches/wal/mod.rs b/src/storage/benches/wal/mod.rs index cac6d037f9..7966e66e0f 100644 --- a/src/storage/benches/wal/mod.rs +++ b/src/storage/benches/wal/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod bench_decode; pub mod bench_encode; pub mod bench_wal; diff --git a/src/storage/benches/wal/util/mod.rs b/src/storage/benches/wal/util/mod.rs index 5efa5cc64d..47bd3766c0 100644 --- a/src/storage/benches/wal/util/mod.rs +++ b/src/storage/benches/wal/util/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod write_batch_util; use std::sync::Arc; diff --git a/src/storage/benches/wal/util/write_batch_util.rs b/src/storage/benches/wal/util/write_batch_util.rs index 8bcb167e0f..b3743d5cc2 100644 --- a/src/storage/benches/wal/util/write_batch_util.rs +++ b/src/storage/benches/wal/util/write_batch_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use storage::write_batch::WriteBatch; use crate::memtable::util::schema_util::{self, ColumnDef}; diff --git a/src/storage/build.rs b/src/storage/build.rs index 04107376ed..7397154783 100644 --- a/src/storage/build.rs +++ b/src/storage/build.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + fn main() { tonic_build::configure() .compile(&["proto/wal.proto", "proto/write_batch.proto"], &["."]) diff --git a/src/storage/src/background.rs b/src/storage/src/background.rs index 775c0aac1e..015c413824 100644 --- a/src/storage/src/background.rs +++ b/src/storage/src/background.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Background job management. use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/storage/src/chunk.rs b/src/storage/src/chunk.rs index 96bdabc196..f39f2db9c6 100644 --- a/src/storage/src/chunk.rs +++ b/src/storage/src/chunk.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use async_trait::async_trait; diff --git a/src/storage/src/codec.rs b/src/storage/src/codec.rs index 691c69aa3d..8dfe29482a 100644 --- a/src/storage/src/codec.rs +++ b/src/storage/src/codec.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_error::prelude::ErrorExt; pub trait Encoder { diff --git a/src/storage/src/config.rs b/src/storage/src/config.rs index b1adf325e7..3522790c3e 100644 --- a/src/storage/src/config.rs +++ b/src/storage/src/config.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! storage engine config #[derive(Debug, Default, Clone)] diff --git a/src/storage/src/engine.rs b/src/storage/src/engine.rs index 6863d13420..ac1588458e 100644 --- a/src/storage/src/engine.rs +++ b/src/storage/src/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::{Arc, RwLock}; diff --git a/src/storage/src/error.rs b/src/storage/src/error.rs index 7de6a4e0b7..d18054f6fb 100644 --- a/src/storage/src/error.rs +++ b/src/storage/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::io::Error as IoError; use std::str::Utf8Error; diff --git a/src/storage/src/flush.rs b/src/storage/src/flush.rs index fef253bf52..9996919b3b 100644 --- a/src/storage/src/flush.rs +++ b/src/storage/src/flush.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use async_trait::async_trait; diff --git a/src/storage/src/lib.rs b/src/storage/src/lib.rs index 769a191851..0c41d5b678 100644 --- a/src/storage/src/lib.rs +++ b/src/storage/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Storage engine implementation. #![feature(map_first_last)] mod background; diff --git a/src/storage/src/manifest.rs b/src/storage/src/manifest.rs index ada6d31b21..c9c740e184 100644 --- a/src/storage/src/manifest.rs +++ b/src/storage/src/manifest.rs @@ -1,6 +1,19 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! manifest storage pub(crate) mod action; -pub(crate) mod checkpoint; pub mod helper; mod impl_; pub mod region; diff --git a/src/storage/src/manifest/action.rs b/src/storage/src/manifest/action.rs index b28d195b05..6c53aaf941 100644 --- a/src/storage/src/manifest/action.rs +++ b/src/storage/src/manifest/action.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io::{BufRead, BufReader}; use serde::{Deserialize, Serialize}; diff --git a/src/storage/src/manifest/checkpoint.rs b/src/storage/src/manifest/checkpoint.rs deleted file mode 100644 index 8b13789179..0000000000 --- a/src/storage/src/manifest/checkpoint.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/storage/src/manifest/helper.rs b/src/storage/src/manifest/helper.rs index eb9a0f6b6b..1c68d10862 100644 --- a/src/storage/src/manifest/helper.rs +++ b/src/storage/src/manifest/helper.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io::Write; use serde::Serialize; diff --git a/src/storage/src/manifest/impl_.rs b/src/storage/src/manifest/impl_.rs index 6f229fa473..2794796433 100644 --- a/src/storage/src/manifest/impl_.rs +++ b/src/storage/src/manifest/impl_.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::marker::PhantomData; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; diff --git a/src/storage/src/manifest/region.rs b/src/storage/src/manifest/region.rs index ce3763dfb2..b56cd6aae8 100644 --- a/src/storage/src/manifest/region.rs +++ b/src/storage/src/manifest/region.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Region manifest impl use crate::manifest::action::*; use crate::manifest::ManifestImpl; diff --git a/src/storage/src/manifest/storage.rs b/src/storage/src/manifest/storage.rs index 06abcf6c05..4edbd02a81 100644 --- a/src/storage/src/manifest/storage.rs +++ b/src/storage/src/manifest/storage.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::iter::Iterator; diff --git a/src/storage/src/manifest/test_utils.rs b/src/storage/src/manifest/test_utils.rs index 154165c7ff..ab3fc7bb49 100644 --- a/src/storage/src/manifest/test_utils.rs +++ b/src/storage/src/manifest/test_utils.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::type_id::LogicalTypeId; use store_api::storage::SequenceNumber; diff --git a/src/storage/src/memtable.rs b/src/storage/src/memtable.rs index 846a5a3ead..101e10544f 100644 --- a/src/storage/src/memtable.rs +++ b/src/storage/src/memtable.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod btree; mod inserter; #[cfg(test)] diff --git a/src/storage/src/memtable/btree.rs b/src/storage/src/memtable/btree.rs index 4fe96d28b9..a06c6ee5a7 100644 --- a/src/storage/src/memtable/btree.rs +++ b/src/storage/src/memtable/btree.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use std::collections::{btree_map, BTreeMap}; use std::ops::Bound; diff --git a/src/storage/src/memtable/inserter.rs b/src/storage/src/memtable/inserter.rs index 64d6f9e8dd..6f0ea70b0f 100644 --- a/src/storage/src/memtable/inserter.rs +++ b/src/storage/src/memtable/inserter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::vectors::VectorRef; use snafu::OptionExt; use store_api::storage::{ColumnDescriptor, OpType, SequenceNumber}; diff --git a/src/storage/src/memtable/tests.rs b/src/storage/src/memtable/tests.rs index 4f5d773b3e..d51cc844ca 100644 --- a/src/storage/src/memtable/tests.rs +++ b/src/storage/src/memtable/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_time::timestamp::Timestamp; use datatypes::arrow; use datatypes::arrow::array::{Int64Array, PrimitiveArray, UInt64Array, UInt8Array}; diff --git a/src/storage/src/memtable/version.rs b/src/storage/src/memtable/version.rs index f6f764f64d..cce626677c 100644 --- a/src/storage/src/memtable/version.rs +++ b/src/storage/src/memtable/version.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use common_time::RangeMillis; diff --git a/src/storage/src/metadata.rs b/src/storage/src/metadata.rs index 580327b6d2..3808f4f14f 100644 --- a/src/storage/src/metadata.rs +++ b/src/storage/src/metadata.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::{HashMap, HashSet}; use std::num::ParseIntError; use std::str::FromStr; diff --git a/src/storage/src/proto.rs b/src/storage/src/proto.rs index f047bdd16c..6aa66c03a0 100644 --- a/src/storage/src/proto.rs +++ b/src/storage/src/proto.rs @@ -1,2 +1,16 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod wal; pub mod write_batch; diff --git a/src/storage/src/proto/wal.rs b/src/storage/src/proto/wal.rs index 557f772525..f410fb6639 100644 --- a/src/storage/src/proto/wal.rs +++ b/src/storage/src/proto/wal.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(clippy::all)] tonic::include_proto!("greptime.storage.wal.v1"); diff --git a/src/storage/src/proto/write_batch.rs b/src/storage/src/proto/write_batch.rs index a0885be45c..7d5ef21aed 100644 --- a/src/storage/src/proto/write_batch.rs +++ b/src/storage/src/proto/write_batch.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![allow(clippy::all)] tonic::include_proto!("greptime.storage.write_batch.v1"); diff --git a/src/storage/src/read.rs b/src/storage/src/read.rs index 616d130a82..6893060be7 100644 --- a/src/storage/src/read.rs +++ b/src/storage/src/read.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Common structs and utilities for read. mod dedup; diff --git a/src/storage/src/read/dedup.rs b/src/storage/src/read/dedup.rs index 95b3a44703..30e3c2b24e 100644 --- a/src/storage/src/read/dedup.rs +++ b/src/storage/src/read/dedup.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use datatypes::arrow::bitmap::MutableBitmap; use datatypes::vectors::BooleanVector; diff --git a/src/storage/src/read/merge.rs b/src/storage/src/read/merge.rs index a620141830..75c5d112dd 100644 --- a/src/storage/src/read/merge.rs +++ b/src/storage/src/read/merge.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Merge reader. //! //! The implementation of [`MergeReader`] is inspired by diff --git a/src/storage/src/region.rs b/src/storage/src/region.rs index 1ee1364f50..4a44f94f89 100644 --- a/src/storage/src/region.rs +++ b/src/storage/src/region.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[cfg(test)] mod tests; mod writer; diff --git a/src/storage/src/region/tests.rs b/src/storage/src/region/tests.rs index c76c5d3ad2..57357f2da0 100644 --- a/src/storage/src/region/tests.rs +++ b/src/storage/src/region/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Region tests. mod alter; diff --git a/src/storage/src/region/tests/alter.rs b/src/storage/src/region/tests/alter.rs index 5cff8fba39..3ab273f1bb 100644 --- a/src/storage/src/region/tests/alter.rs +++ b/src/storage/src/region/tests/alter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::BTreeMap; use std::sync::Arc; diff --git a/src/storage/src/region/tests/basic.rs b/src/storage/src/region/tests/basic.rs index 3265209f8c..c5352669a5 100644 --- a/src/storage/src/region/tests/basic.rs +++ b/src/storage/src/region/tests/basic.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Region read/write tests. use log_store::fs::log::LocalFileLogStore; diff --git a/src/storage/src/region/tests/flush.rs b/src/storage/src/region/tests/flush.rs index fdf4e2528d..eadb4d5b5b 100644 --- a/src/storage/src/region/tests/flush.rs +++ b/src/storage/src/region/tests/flush.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Region flush tests. use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/storage/src/region/tests/projection.rs b/src/storage/src/region/tests/projection.rs index 72a5d0e2c5..d607f41133 100644 --- a/src/storage/src/region/tests/projection.rs +++ b/src/storage/src/region/tests/projection.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datatypes::data_type::ConcreteDataType; diff --git a/src/storage/src/region/writer.rs b/src/storage/src/region/writer.rs index 34accb1401..be4095fefd 100644 --- a/src/storage/src/region/writer.rs +++ b/src/storage/src/region/writer.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_telemetry::logging; diff --git a/src/storage/src/schema.rs b/src/storage/src/schema.rs index 12ab495d2c..6bc344f3a7 100644 --- a/src/storage/src/schema.rs +++ b/src/storage/src/schema.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod compat; mod projected; mod region; diff --git a/src/storage/src/schema/compat.rs b/src/storage/src/schema/compat.rs index 4fcd9210dd..5e1c22cd77 100644 --- a/src/storage/src/schema/compat.rs +++ b/src/storage/src/schema/compat.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Utilities for resolving schema compatibility problems. use std::sync::Arc; diff --git a/src/storage/src/schema/projected.rs b/src/storage/src/schema/projected.rs index a57fb1aab3..ec940a9d34 100644 --- a/src/storage/src/schema/projected.rs +++ b/src/storage/src/schema/projected.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp::Ordering; use std::collections::{BTreeSet, HashMap}; use std::sync::Arc; diff --git a/src/storage/src/schema/region.rs b/src/storage/src/schema/region.rs index 6e67c5a55c..bfc046c868 100644 --- a/src/storage/src/schema/region.rs +++ b/src/storage/src/schema/region.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_error::prelude::*; diff --git a/src/storage/src/schema/store.rs b/src/storage/src/schema/store.rs index b706540fc0..681059b256 100644 --- a/src/storage/src/schema/store.rs +++ b/src/storage/src/schema/store.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use common_error::prelude::*; diff --git a/src/storage/src/snapshot.rs b/src/storage/src/snapshot.rs index c7177f926d..32d030ba8e 100644 --- a/src/storage/src/snapshot.rs +++ b/src/storage/src/snapshot.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::cmp; use async_trait::async_trait; diff --git a/src/storage/src/sst.rs b/src/storage/src/sst.rs index 3d2123bdb6..273841809e 100644 --- a/src/storage/src/sst.rs +++ b/src/storage/src/sst.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod parquet; use std::sync::Arc; diff --git a/src/storage/src/sst/parquet.rs b/src/storage/src/sst/parquet.rs index f96b9129e5..1864cd6bcb 100644 --- a/src/storage/src/sst/parquet.rs +++ b/src/storage/src/sst/parquet.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Parquet sst format. use std::collections::HashMap; diff --git a/src/storage/src/sync.rs b/src/storage/src/sync.rs index 7408db7d94..5f1164c146 100644 --- a/src/storage/src/sync.rs +++ b/src/storage/src/sync.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Synchronization utilities use std::ops::{Deref, DerefMut}; diff --git a/src/storage/src/test_util.rs b/src/storage/src/test_util.rs index 7b67ac4886..a24f7b2430 100644 --- a/src/storage/src/test_util.rs +++ b/src/storage/src/test_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod config_util; pub mod descriptor_util; pub mod read_util; diff --git a/src/storage/src/test_util/config_util.rs b/src/storage/src/test_util/config_util.rs index 829c4873e8..451c478188 100644 --- a/src/storage/src/test_util/config_util.rs +++ b/src/storage/src/test_util/config_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use log_store::fs::config::LogConfig; diff --git a/src/storage/src/test_util/descriptor_util.rs b/src/storage/src/test_util/descriptor_util.rs index 21f18826a8..50c8c2613e 100644 --- a/src/storage/src/test_util/descriptor_util.rs +++ b/src/storage/src/test_util/descriptor_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::prelude::ConcreteDataType; use datatypes::type_id::LogicalTypeId; use store_api::storage::{ diff --git a/src/storage/src/test_util/read_util.rs b/src/storage/src/test_util/read_util.rs index b15b43a004..1b62611dc6 100644 --- a/src/storage/src/test_util/read_util.rs +++ b/src/storage/src/test_util/read_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use async_trait::async_trait; diff --git a/src/storage/src/test_util/schema_util.rs b/src/storage/src/test_util/schema_util.rs index ea2a3d379d..61b4621f14 100644 --- a/src/storage/src/test_util/schema_util.rs +++ b/src/storage/src/test_util/schema_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use datatypes::prelude::*; diff --git a/src/storage/src/test_util/write_batch_util.rs b/src/storage/src/test_util/write_batch_util.rs index 5d56b3080e..baace78039 100644 --- a/src/storage/src/test_util/write_batch_util.rs +++ b/src/storage/src/test_util/write_batch_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::test_util::schema_util::{self, ColumnDef}; use crate::write_batch::WriteBatch; diff --git a/src/storage/src/version.rs b/src/storage/src/version.rs index bf42615e23..67b43fef48 100644 --- a/src/storage/src/version.rs +++ b/src/storage/src/version.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Version control of storage. //! //! To read latest data from `VersionControl`, we need to diff --git a/src/storage/src/wal.rs b/src/storage/src/wal.rs index 3a5ed29bdc..acd5baca63 100644 --- a/src/storage/src/wal.rs +++ b/src/storage/src/wal.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::pin::Pin; use std::sync::Arc; diff --git a/src/storage/src/write_batch.rs b/src/storage/src/write_batch.rs index 87883d3f6e..10d66bcd25 100644 --- a/src/storage/src/write_batch.rs +++ b/src/storage/src/write_batch.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod compat; use std::any::Any; diff --git a/src/storage/src/write_batch/compat.rs b/src/storage/src/write_batch/compat.rs index e8044a7d64..dcd9d155c3 100644 --- a/src/storage/src/write_batch/compat.rs +++ b/src/storage/src/write_batch/compat.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datatypes::schema::{ColumnSchema, SchemaRef}; use snafu::{ensure, ResultExt}; diff --git a/src/store-api/Cargo.toml b/src/store-api/Cargo.toml index 666b081407..d3bd1ecb76 100644 --- a/src/store-api/Cargo.toml +++ b/src/store-api/Cargo.toml @@ -2,7 +2,7 @@ name = "store-api" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +license = "Apache-2.0" [dependencies] async-trait = "0.1" diff --git a/src/store-api/src/lib.rs b/src/store-api/src/lib.rs index ab381487f0..080e87a83a 100644 --- a/src/store-api/src/lib.rs +++ b/src/store-api/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Storage related APIs pub mod logstore; pub mod manifest; diff --git a/src/store-api/src/logstore.rs b/src/store-api/src/logstore.rs index 390b33ab2c..effe838d44 100644 --- a/src/store-api/src/logstore.rs +++ b/src/store-api/src/logstore.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! LogStore APIs. use common_error::prelude::ErrorExt; diff --git a/src/store-api/src/logstore/entry.rs b/src/store-api/src/logstore/entry.rs index 4ed9e8f565..3fa7aad06d 100644 --- a/src/store-api/src/logstore/entry.rs +++ b/src/store-api/src/logstore/entry.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use common_base::buffer::{Buffer, BufferMut}; use common_error::ext::ErrorExt; diff --git a/src/store-api/src/logstore/entry_stream.rs b/src/store-api/src/logstore/entry_stream.rs index fb96393713..6d9cfa9c8e 100644 --- a/src/store-api/src/logstore/entry_stream.rs +++ b/src/store-api/src/logstore/entry_stream.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::pin::Pin; use common_error::prelude::ErrorExt; diff --git a/src/store-api/src/logstore/namespace.rs b/src/store-api/src/logstore/namespace.rs index be12aa43ea..bf71ca4641 100644 --- a/src/store-api/src/logstore/namespace.rs +++ b/src/store-api/src/logstore/namespace.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub type Id = u64; pub trait Namespace: Send + Sync + Clone + std::fmt::Debug { diff --git a/src/store-api/src/manifest.rs b/src/store-api/src/manifest.rs index 1f1515f5aa..105c1ada95 100644 --- a/src/store-api/src/manifest.rs +++ b/src/store-api/src/manifest.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! metadata service pub mod action; mod storage; diff --git a/src/store-api/src/manifest/action.rs b/src/store-api/src/manifest/action.rs index 3675762c16..a777004dfa 100644 --- a/src/store-api/src/manifest/action.rs +++ b/src/store-api/src/manifest/action.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + ///! Common actions for manifest use serde::{Deserialize, Serialize}; diff --git a/src/store-api/src/manifest/storage.rs b/src/store-api/src/manifest/storage.rs index 4ac7bec50c..5150fc6d6a 100644 --- a/src/store-api/src/manifest/storage.rs +++ b/src/store-api/src/manifest/storage.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_error::ext::ErrorExt; diff --git a/src/store-api/src/storage.rs b/src/store-api/src/storage.rs index ff7169a01a..154c99b385 100644 --- a/src/store-api/src/storage.rs +++ b/src/store-api/src/storage.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Storage APIs. mod chunk; diff --git a/src/store-api/src/storage/chunk.rs b/src/store-api/src/storage/chunk.rs index 1c43825330..ca7a8e1736 100644 --- a/src/store-api/src/storage/chunk.rs +++ b/src/store-api/src/storage/chunk.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_error::ext::ErrorExt; use datatypes::vectors::VectorRef; diff --git a/src/store-api/src/storage/consts.rs b/src/store-api/src/storage/consts.rs index 70473973fb..68352b14ca 100644 --- a/src/store-api/src/storage/consts.rs +++ b/src/store-api/src/storage/consts.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Constants. use crate::storage::descriptors::{ColumnFamilyId, ColumnId}; diff --git a/src/store-api/src/storage/descriptors.rs b/src/store-api/src/storage/descriptors.rs index 7fa50f6e1d..9942239286 100644 --- a/src/store-api/src/storage/descriptors.rs +++ b/src/store-api/src/storage/descriptors.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use derive_builder::Builder; use serde::{Deserialize, Serialize}; diff --git a/src/store-api/src/storage/engine.rs b/src/store-api/src/storage/engine.rs index e9bdc27eaf..651c422cb5 100644 --- a/src/store-api/src/storage/engine.rs +++ b/src/store-api/src/storage/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Storage Engine traits. //! //! [`StorageEngine`] is the abstraction over a multi-regions, schematized data storage system, diff --git a/src/store-api/src/storage/metadata.rs b/src/store-api/src/storage/metadata.rs index bf2ef6537e..67dfb30f5b 100644 --- a/src/store-api/src/storage/metadata.rs +++ b/src/store-api/src/storage/metadata.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use crate::storage::SchemaRef; /// Metadata of a region. diff --git a/src/store-api/src/storage/region.rs b/src/store-api/src/storage/region.rs index c223f927e5..236b6681d4 100644 --- a/src/store-api/src/storage/region.rs +++ b/src/store-api/src/storage/region.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Region holds chunks of rows stored in the storage engine, but does not require that //! rows must have continuous primary key range, which is implementation specific. //! diff --git a/src/store-api/src/storage/requests.rs b/src/store-api/src/storage/requests.rs index aac0b415d6..6e7184810a 100644 --- a/src/store-api/src/storage/requests.rs +++ b/src/store-api/src/storage/requests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashSet; use std::time::Duration; diff --git a/src/store-api/src/storage/responses.rs b/src/store-api/src/storage/responses.rs index 7cd094abff..d5fe32669d 100644 --- a/src/store-api/src/storage/responses.rs +++ b/src/store-api/src/storage/responses.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[derive(Debug)] pub struct WriteResponse {} diff --git a/src/store-api/src/storage/snapshot.rs b/src/store-api/src/storage/snapshot.rs index 7761c69c4d..0532c99483 100644 --- a/src/store-api/src/storage/snapshot.rs +++ b/src/store-api/src/storage/snapshot.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use async_trait::async_trait; use common_error::ext::ErrorExt; use datatypes::schema::SchemaRef; diff --git a/src/store-api/src/storage/types.rs b/src/store-api/src/storage/types.rs index b88805e617..ecca8e4f64 100644 --- a/src/store-api/src/storage/types.rs +++ b/src/store-api/src/storage/types.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Common types. /// Represents a sequence number of data in storage. The offset of logstore can be used diff --git a/src/table-engine/Cargo.toml b/src/table-engine/Cargo.toml index 7bb20fc5a4..3a81c782bd 100644 --- a/src/table-engine/Cargo.toml +++ b/src/table-engine/Cargo.toml @@ -2,6 +2,7 @@ name = "table-engine" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [features] default = [] @@ -18,7 +19,9 @@ common-query = { path = "../common/query" } common-recordbatch = { path = "../common/recordbatch" } common-telemetry = { path = "../common/telemetry" } common-time = { path = "../common/time" } -datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = ["simd"] } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2", features = [ + "simd", +] } datafusion-common = { git = "https://github.com/apache/arrow-datafusion.git", branch = "arrow2" } datatypes = { path = "../datatypes" } futures = "0.3" diff --git a/src/table-engine/src/config.rs b/src/table-engine/src/config.rs index 335fce4069..4bac9a52ab 100644 --- a/src/table-engine/src/config.rs +++ b/src/table-engine/src/config.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Table Engine config #[derive(Debug, Clone, Default)] diff --git a/src/table-engine/src/engine.rs b/src/table-engine/src/engine.rs index 43e56616ba..29e2f09c74 100644 --- a/src/table-engine/src/engine.rs +++ b/src/table-engine/src/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::{Arc, RwLock}; diff --git a/src/table-engine/src/error.rs b/src/table-engine/src/error.rs index 13035742f9..ff3321ef7a 100644 --- a/src/table-engine/src/error.rs +++ b/src/table-engine/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::ext::BoxedError; diff --git a/src/table-engine/src/lib.rs b/src/table-engine/src/lib.rs index 462396858a..ec2fb53785 100644 --- a/src/table-engine/src/lib.rs +++ b/src/table-engine/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod config; pub mod engine; pub mod error; diff --git a/src/table-engine/src/manifest.rs b/src/table-engine/src/manifest.rs index 522ed3206c..1de7148c23 100644 --- a/src/table-engine/src/manifest.rs +++ b/src/table-engine/src/manifest.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Table manifest service pub mod action; diff --git a/src/table-engine/src/manifest/action.rs b/src/table-engine/src/manifest/action.rs index a0711aff92..f8428367d4 100644 --- a/src/table-engine/src/manifest/action.rs +++ b/src/table-engine/src/manifest/action.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::io::{BufRead, BufReader}; use serde::{Deserialize, Serialize}; diff --git a/src/table-engine/src/table.rs b/src/table-engine/src/table.rs index 0d2ce8de14..705b8b0356 100644 --- a/src/table-engine/src/table.rs +++ b/src/table-engine/src/table.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #[cfg(any(test, feature = "test"))] pub mod test_util; diff --git a/src/table-engine/src/table/test_util.rs b/src/table-engine/src/table/test_util.rs index 15f6c06346..80f736c26d 100644 --- a/src/table-engine/src/table/test_util.rs +++ b/src/table-engine/src/table/test_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod mock_engine; use std::collections::HashMap; use std::sync::Arc; diff --git a/src/table-engine/src/table/test_util/mock_engine.rs b/src/table-engine/src/table/test_util/mock_engine.rs index 6972c27d4b..08b137cdc7 100644 --- a/src/table-engine/src/table/test_util/mock_engine.rs +++ b/src/table-engine/src/table/test_util/mock_engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! A mock storage engine for table test purpose. use std::collections::HashMap; diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml index 41ef7c815f..0d0d352cd7 100644 --- a/src/table/Cargo.toml +++ b/src/table/Cargo.toml @@ -2,6 +2,7 @@ name = "table" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [dependencies] async-trait = "0.1" diff --git a/src/table/src/engine.rs b/src/table/src/engine.rs index a2ed36bbc7..d2983e547b 100644 --- a/src/table/src/engine.rs +++ b/src/table/src/engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::fmt::{self, Display}; use std::sync::Arc; diff --git a/src/table/src/error.rs b/src/table/src/error.rs index aadd0a6bc4..ed18c471ce 100644 --- a/src/table/src/error.rs +++ b/src/table/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use common_error::prelude::*; diff --git a/src/table/src/lib.rs b/src/table/src/lib.rs index 808d4714c4..9c86665ff6 100644 --- a/src/table/src/lib.rs +++ b/src/table/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod engine; pub mod error; pub mod metadata; diff --git a/src/table/src/metadata.rs b/src/table/src/metadata.rs index 460576027b..4676823c21 100644 --- a/src/table/src/metadata.rs +++ b/src/table/src/metadata.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::{HashMap, HashSet}; use std::sync::Arc; diff --git a/src/table/src/predicate.rs b/src/table/src/predicate.rs index 058e5efbaf..64d32d57f4 100644 --- a/src/table/src/predicate.rs +++ b/src/table/src/predicate.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod stats; use common_query::logical_plan::Expr; diff --git a/src/table/src/predicate/stats.rs b/src/table/src/predicate/stats.rs index b1e5d0d5a5..b474eddeb1 100644 --- a/src/table/src/predicate/stats.rs +++ b/src/table/src/predicate/stats.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use datafusion::parquet::metadata::RowGroupMetaData; use datafusion::parquet::statistics::{ BinaryStatistics, BooleanStatistics, FixedLenStatistics, PrimitiveStatistics, diff --git a/src/table/src/requests.rs b/src/table/src/requests.rs index 1f72077d70..344d722103 100644 --- a/src/table/src/requests.rs +++ b/src/table/src/requests.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! Table and TableEngine requests use std::collections::HashMap; diff --git a/src/table/src/table.rs b/src/table/src/table.rs index 55e74051eb..f3ba11245b 100644 --- a/src/table/src/table.rs +++ b/src/table/src/table.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod adapter; pub mod numbers; pub mod scan; diff --git a/src/table/src/table/adapter.rs b/src/table/src/table/adapter.rs index d970f7a62d..32824e7a49 100644 --- a/src/table/src/table/adapter.rs +++ b/src/table/src/table/adapter.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::sync::Arc; diff --git a/src/table/src/table/numbers.rs b/src/table/src/table/numbers.rs index cf4f4303a2..26eab9a8bf 100644 --- a/src/table/src/table/numbers.rs +++ b/src/table/src/table/numbers.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::pin::Pin; use std::sync::Arc; diff --git a/src/table/src/table/scan.rs b/src/table/src/table/scan.rs index 6f1fe0f7cb..73d5dd8181 100644 --- a/src/table/src/table/scan.rs +++ b/src/table/src/table/scan.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::fmt::{Debug, Formatter}; use std::sync::{Arc, Mutex}; diff --git a/src/table/src/test_util.rs b/src/table/src/test_util.rs index 49cb19c2e1..0cadbf6891 100644 --- a/src/table/src/test_util.rs +++ b/src/table/src/test_util.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + mod empty_table; mod memtable; mod mock_engine; diff --git a/src/table/src/test_util/empty_table.rs b/src/table/src/test_util/empty_table.rs index eba10de20a..55b5e4f25d 100644 --- a/src/table/src/test_util/empty_table.rs +++ b/src/table/src/test_util/empty_table.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use async_trait::async_trait; diff --git a/src/table/src/test_util/memtable.rs b/src/table/src/test_util/memtable.rs index fda215d94c..aa16d15b79 100644 --- a/src/table/src/test_util/memtable.rs +++ b/src/table/src/test_util/memtable.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::any::Any; use std::pin::Pin; use std::sync::Arc; diff --git a/src/table/src/test_util/mock_engine.rs b/src/table/src/test_util/mock_engine.rs index 8142ccf0ac..af14a6112b 100644 --- a/src/table/src/test_util/mock_engine.rs +++ b/src/table/src/test_util/mock_engine.rs @@ -1,3 +1,17 @@ +// Copyright 2022 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::sync::Arc;