diff --git a/.arclint b/.arclint index 560c165400b..54d7f829f54 100644 --- a/.arclint +++ b/.arclint @@ -23,6 +23,7 @@ "(^src/stirling/bpf_tools/bcc_bpf/system-headers)", "(^src/stirling/mysql/testing/.*\\.json$)", "(^src/stirling/obj_tools/testdata/go/test_go_binary.go)", + "(^src/stirling/source_connectors/file_source/testdata/test.json$)", "(^src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/main.go$)", "(^src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/main.go$)", "(^src/stirling/utils/testdata/config$)", diff --git a/.bazelrc b/.bazelrc index 86182129958..8d48f599d7b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,6 +3,9 @@ # Use strict action env to prevent leaks of env vars. build --incompatible_strict_action_env +# Use cache +# build --disk_cache=/tmp/bazel/cache # must not be merged dev only settng + # Only pass through GH_API_KEY for stamped builds. # This is still not ideal as it still busts the cache of stamped builds. build:stamp --stamp diff --git a/BUILD.bazel b/BUILD.bazel index 177a71158a6..874f7e13e5e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,3 +1,6 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@px//bazel:pl_build_system.bzl", "pl_go_binary") + # Copyright 2018- The Pixie Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,6 +59,7 @@ gazelle( # gazelle:resolve go px.dev/pixie/src/carnot/docspb //src/carnot/docspb:docs_pl_go_proto # gazelle:resolve go px.dev/pixie/src/carnot/planner/compilerpb //src/carnot/planner/compilerpb:compiler_status_pl_go_proto # gazelle:resolve go px.dev/pixie/src/carnot/planner/distributedpb //src/carnot/planner/distributedpb:distributed_plan_pl_go_proto +# gazelle:resolve go px.dev/pixie/src/carnot/planner/file_source/ir //src/carnot/planner/file_source/ir:logical_pl_go_proto # gazelle:resolve go px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb //src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto # gazelle:resolve go px.dev/pixie/src/carnot/planner/plannerpb //src/carnot/planner/plannerpb:service_pl_go_proto # gazelle:resolve go px.dev/pixie/src/carnot/planpb //src/carnot/planpb:plan_pl_go_proto @@ -216,3 +220,16 @@ filegroup( srcs = ["go.sum"], visibility = ["//visibility:public"], ) + +go_library( + name = "pixie_lib", + srcs = ["gosym_tab_experiment.go"], + importpath = "px.dev/pixie", + visibility = ["//visibility:private"], +) + +pl_go_binary( + name = "pixie", + embed = [":pixie_lib"], + visibility = ["//visibility:public"], +) diff --git a/WORKSPACE b/WORKSPACE index f375888b5fe..0097fee36c5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -204,7 +204,7 @@ bind( ) # gazelle:repo bazel_gazelle -# Gazelle depes need to be loaded last to make sure they don't override our dependencies. +# Gazelle deps need to be loaded last to make sure they don't override our dependencies. # The first one wins when it comes to package declaration. load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") diff --git a/demos/log-generator/log-generator.yaml b/demos/log-generator/log-generator.yaml new file mode 100644 index 00000000000..ac05a56118b --- /dev/null +++ b/demos/log-generator/log-generator.yaml @@ -0,0 +1,89 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: px-log-generator +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: vector-config + namespace: px-log-generator +data: + vector.toml: | + [sources.demo] + type = "demo_logs" + format = "json" + + [sinks.json_output] + type = "file" + inputs = ["demo"] + path = "/var/log/px-log-generator.json" + encoding.codec = "json" +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: vector-logrotate-config + namespace: px-log-generator +data: + logrotate.conf: | + /var/log/px-log-generator.json { + size 30M + copytruncate + rotate 5 + compress + missingok + notifempty + } +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: vector + namespace: px-log-generator +spec: + selector: + matchLabels: + app: vector + template: + metadata: + labels: + app: vector + spec: + volumes: + - name: log-storage + hostPath: + path: /var/log + type: Directory + - name: logrotate-config + configMap: + name: vector-logrotate-config + - name: config-volume + configMap: + name: vector-config + initContainers: + - name: cleanup + image: busybox + command: ["/bin/sh", "-c", "truncate -s0 /var/log/px-log-generator.json"] + volumeMounts: + - name: log-storage + mountPath: /var/log + containers: + - name: vector + image: timberio/vector@sha256:f8933ff1a3ec08df45abc6130947938d98dc85792a25592ec1aa6fe83a7f562c # 0.44.0-debian + args: ["--config", "/etc/vector/vector.toml"] + volumeMounts: + - name: config-volume + mountPath: /etc/vector + - name: log-storage + mountPath: /var/log + - name: logrotate + image: vitess/logrotate@sha256:ba0f99827d0e2d0bda86230ff6666e75383d93babcbc6c803c4d41396214f312 # v21.0.2-bookworm + volumeMounts: + - name: logrotate-config + mountPath: /vt/logrotate.conf + subPath: logrotate.conf + - name: log-storage + mountPath: /var/log + terminationGracePeriodSeconds: 10 + restartPolicy: Always diff --git a/skaffold/skaffold_vizier.yaml b/skaffold/skaffold_vizier.yaml index 2b6218a8c7d..439cda8c41c 100644 --- a/skaffold/skaffold_vizier.yaml +++ b/skaffold/skaffold_vizier.yaml @@ -8,37 +8,43 @@ build: bazel: target: //src/vizier/services/agent/pem:pem_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt - image: vizier-kelvin_image context: . bazel: target: //src/vizier/services/agent/kelvin:kelvin_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt - image: vizier-metadata_server_image context: . bazel: target: //src/vizier/services/metadata:metadata_server_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt - image: vizier-query_broker_server_image context: . bazel: target: //src/vizier/services/query_broker:query_broker_server_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt - image: vizier-cloud_connector_server_image context: . bazel: target: //src/vizier/services/cloud_connector:cloud_connector_server_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt - image: vizier-cert_provisioner_image context: . bazel: target: //src/utils/cert_provisioner:cert_provisioner_image.tar args: - - --compilation_mode=dbg + - --config=x86_64_sysroot + - --compilation_mode=opt tagPolicy: dateTime: {} local: diff --git a/src/api/go/pxapi/examples/standalone_pem_example/example.go b/src/api/go/pxapi/examples/standalone_pem_example/example.go index 64e1e3b10da..3b3247e11dd 100644 --- a/src/api/go/pxapi/examples/standalone_pem_example/example.go +++ b/src/api/go/pxapi/examples/standalone_pem_example/example.go @@ -30,18 +30,66 @@ import ( // Define PxL script with one table output. var ( + stream = ` +import px +df = px.DataFrame('http_events') +px.display(df.stream()) +` pxl = ` import px +import pxlog +table = 'vector.json' +f = '/home/ddelnano/code/pixie-worktree/vector.json' +pxlog.FileSource(f, table, '5m') +df = px.DataFrame(table) -# Look at the http_events. -df = px.DataFrame(table='http_events') - -# Grab the command line from the metadata. -df.cmdline = px.upid_to_cmdline(df.upid) - -# Limit to the first 10. -df = df.head(10) - +px.display(df)` + bpftrace = ` +import pxtrace +import px +# Adapted from https://github.com/iovisor/bpftrace/blob/master/tools/tcpretrans.bt +program = """ +// tcpretrans.bt Trace or count TCP retransmits +// For Linux, uses bpftrace and eBPF. +// +// Copyright (c) 2018 Dale Hamel. +// Licensed under the Apache License, Version 2.0 (the "License") +#include +#include +kprobe:tcp_retransmit_skb +{ + $sk = (struct sock *)arg0; + $inet_family = $sk->__sk_common.skc_family; + $AF_INET = (uint16) 2; + $AF_INET6 = (uint16) 10; + if ($inet_family == $AF_INET || $inet_family == $AF_INET6) { + if ($inet_family == $AF_INET) { + $daddr = ntop($sk->__sk_common.skc_daddr); + $saddr = ntop($sk->__sk_common.skc_rcv_saddr); + } else { + $daddr = ntop($sk->__sk_common.skc_v6_daddr.in6_u.u6_addr8); + $saddr = ntop($sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr8); + } + $sport = $sk->__sk_common.skc_num; + $dport = $sk->__sk_common.skc_dport; + // Destination port is big endian, it must be flipped + $dport = ($dport >> 8) | (($dport << 8) & 0x00FF00); + printf(\"time_:%llu src_ip:%s src_port:%d dst_ip:%s dst_port:%d\", + nsecs, + $saddr, + $sport, + $daddr, + $dport); + } +} +""" +table_name = 'tcp_retransmits_table' +pxtrace.UpsertTracepoint('tcp_retranmits_probe', + table_name, + program, + pxtrace.kprobe(), + "2m") +df = px.DataFrame(table=table_name, select=['time_', 'src_ip', 'src_port', 'dst_ip', 'dst_port']) px.display(df)` ) diff --git a/src/api/go/pxapi/vizier.go b/src/api/go/pxapi/vizier.go index ef5b0bcdfcb..88c5404a583 100644 --- a/src/api/go/pxapi/vizier.go +++ b/src/api/go/pxapi/vizier.go @@ -20,6 +20,7 @@ package pxapi import ( "context" + "strings" "px.dev/pixie/src/api/go/pxapi/errdefs" "px.dev/pixie/src/api/proto/vizierpb" @@ -40,6 +41,7 @@ func (v *VizierClient) ExecuteScript(ctx context.Context, pxl string, mux TableM ClusterID: v.vizierID, QueryStr: pxl, EncryptionOptions: v.encOpts, + Mutation: strings.Contains(pxl, "import pxlog") || strings.Contains(pxl, "import pxtrace"), } origCtx := ctx ctx, cancel := context.WithCancel(ctx) diff --git a/src/carnot/carnot.cc b/src/carnot/carnot.cc index a466bb5194d..d3a0dc25947 100644 --- a/src/carnot/carnot.cc +++ b/src/carnot/carnot.cc @@ -378,9 +378,9 @@ Status CarnotImpl::ExecutePlan(const planpb::Plan& logical_plan, const sole::uui int64_t total_time_ns = stats->TotalExecTime(); int64_t self_time_ns = stats->SelfExecTime(); LOG(INFO) << absl::Substitute( - "self_time:$1\ttotal_time: $2\tbytes_output: $3\trows_output: $4\tnode_id:$0", + "self_time:$1\ttotal_time: $2\tbytes_input: $3\tbytes_output: $4\trows_input: $5\trows_output: $6\tnode_id:$0", node_name, PrettyDuration(self_time_ns), PrettyDuration(total_time_ns), - stats->bytes_output, stats->rows_output); + stats->bytes_input, stats->bytes_output, stats->rows_input, stats->rows_output); queryresultspb::OperatorExecutionStats* stats_pb = agent_operator_exec_stats.add_operator_execution_stats(); diff --git a/src/carnot/carnot_test.cc b/src/carnot/carnot_test.cc index 9d32031bfc4..3ea11080844 100644 --- a/src/carnot/carnot_test.cc +++ b/src/carnot/carnot_test.cc @@ -211,7 +211,7 @@ px.display(df, 'range_output'))pxl"; std::vector col0_out1; std::vector col1_out1; std::vector col2_out1; - table_store::Table::Cursor cursor(big_table_.get()); + table_store::Cursor cursor(big_table_.get()); auto batch = cursor.GetNextRowBatch({0}).ConsumeValueOrDie(); for (int64_t i = 0; i < batch->ColumnAt(0)->length(); i++) { if (CarnotTestUtils::big_test_col1[i].val >= 2 && CarnotTestUtils::big_test_col1[i].val < 12) { diff --git a/src/carnot/exec/BUILD.bazel b/src/carnot/exec/BUILD.bazel index 228b352501c..1af775011ba 100644 --- a/src/carnot/exec/BUILD.bazel +++ b/src/carnot/exec/BUILD.bazel @@ -226,6 +226,7 @@ pl_cc_test( deps = [ ":cc_library", ":test_utils", + "//src/common/testing/event:cc_library", "//src/carnot/planpb:plan_testutils", "@com_github_apache_arrow//:arrow", ], @@ -296,6 +297,7 @@ pl_cc_test( ":exec_node_test_helpers", ":test_utils", "//src/carnot/planpb:plan_testutils", + "//src/common/testing/event:cc_library", "@com_github_apache_arrow//:arrow", "@com_github_grpc_grpc//:grpc++_test", ], diff --git a/src/carnot/exec/exec_graph_test.cc b/src/carnot/exec/exec_graph_test.cc index d5c7abb8d89..d578dbac57c 100644 --- a/src/carnot/exec/exec_graph_test.cc +++ b/src/carnot/exec/exec_graph_test.cc @@ -38,6 +38,7 @@ #include "src/carnot/udf/base.h" #include "src/carnot/udf/registry.h" #include "src/carnot/udf/udf.h" +#include "src/common/testing/event/simulated_time_system.h" #include "src/common/testing/testing.h" #include "src/shared/types/arrow_adapter.h" #include "src/shared/types/types.h" @@ -77,6 +78,12 @@ class BaseExecGraphTest : public ::testing::Test { exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); } std::unique_ptr func_registry_; @@ -150,7 +157,7 @@ TEST_P(ExecGraphExecuteTest, execute) { table_store::schema::Relation rel( {types::DataType::INT64, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -175,6 +182,12 @@ TEST_P(ExecGraphExecuteTest, execute) { auto exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); EXPECT_OK(exec_state_->AddScalarUDF( 0, "add", std::vector({types::DataType::INT64, types::DataType::FLOAT64}))); @@ -187,11 +200,14 @@ TEST_P(ExecGraphExecuteTest, execute) { /* collect_exec_node_stats */ false, calls_to_generate); EXPECT_OK(e.Execute()); + auto stats = e.GetStats(); + EXPECT_EQ(stats.bytes_processed, 85); + EXPECT_EQ(stats.rows_processed, 5); auto output_table = exec_state_->table_store()->GetTable("output"); std::vector out_in1 = {4.8, 16.4, 26.4}; std::vector out_in2 = {14.8, 12.4}; - table_store::Table::Cursor cursor(output_table); + table_store::Cursor cursor(output_table); EXPECT_TRUE(cursor.GetNextRowBatch({0}).ConsumeValueOrDie()->ColumnAt(0)->Equals( types::ToArrow(out_in1, arrow::default_memory_pool()))); EXPECT_TRUE(cursor.GetNextRowBatch({0}).ConsumeValueOrDie()->ColumnAt(0)->Equals( @@ -229,7 +245,7 @@ TEST_F(ExecGraphTest, execute_time) { table_store::schema::Relation rel( {types::DataType::TIME64NS, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {types::Time64NSValue(1), types::Time64NSValue(2), @@ -256,6 +272,12 @@ TEST_F(ExecGraphTest, execute_time) { auto exec_state_ = std::make_unique( func_registry.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); EXPECT_OK(exec_state_->AddScalarUDF( 0, "add", std::vector({types::DataType::INT64, types::DataType::FLOAT64}))); @@ -272,7 +294,7 @@ TEST_F(ExecGraphTest, execute_time) { auto output_table = exec_state_->table_store()->GetTable("output"); std::vector out_in1 = {4.8, 16.4, 26.4}; std::vector out_in2 = {14.8, 12.4}; - table_store::Table::Cursor cursor(output_table); + table_store::Cursor cursor(output_table); EXPECT_TRUE(cursor.GetNextRowBatch({0}).ConsumeValueOrDie()->ColumnAt(0)->Equals( types::ToArrow(out_in1, arrow::default_memory_pool()))); EXPECT_TRUE(cursor.GetNextRowBatch({0}).ConsumeValueOrDie()->ColumnAt(0)->Equals( @@ -298,7 +320,7 @@ TEST_F(ExecGraphTest, two_limits_dont_interfere) { table_store::schema::Relation rel( {types::DataType::INT64, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -323,6 +345,12 @@ TEST_F(ExecGraphTest, two_limits_dont_interfere) { auto exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); ExecutionGraph e; auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), @@ -335,8 +363,8 @@ TEST_F(ExecGraphTest, two_limits_dont_interfere) { std::vector out_col1 = {1, 2}; std::vector out_col2 = {true, false}; std::vector out_col3 = {1.4, 6.2}; - table_store::Table::Cursor cursor1(output_table1); - table_store::Table::Cursor cursor2(output_table2); + table_store::Cursor cursor1(output_table1); + table_store::Cursor cursor2(output_table2); auto out_rb1 = cursor1.GetNextRowBatch(std::vector({0, 1, 2})).ConsumeValueOrDie(); auto out_rb2 = cursor2.GetNextRowBatch(std::vector({0, 1, 2})).ConsumeValueOrDie(); @@ -366,7 +394,7 @@ TEST_F(ExecGraphTest, limit_w_multiple_srcs) { table_store::schema::Relation rel( {types::DataType::INT64, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -391,6 +419,12 @@ TEST_F(ExecGraphTest, limit_w_multiple_srcs) { auto exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); ExecutionGraph e; auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), @@ -402,7 +436,7 @@ TEST_F(ExecGraphTest, limit_w_multiple_srcs) { std::vector out_col1 = {1, 2}; std::vector out_col2 = {true, false}; std::vector out_col3 = {1.4, 6.2}; - table_store::Table::Cursor cursor(output_table); + table_store::Cursor cursor(output_table); auto out_rb = cursor.GetNextRowBatch(std::vector({0, 1, 2})).ConsumeValueOrDie(); EXPECT_TRUE(out_rb->ColumnAt(0)->Equals(types::ToArrow(out_col1, arrow::default_memory_pool()))); EXPECT_TRUE(out_rb->ColumnAt(1)->Equals(types::ToArrow(out_col2, arrow::default_memory_pool()))); @@ -427,7 +461,7 @@ TEST_F(ExecGraphTest, two_sequential_limits) { table_store::schema::Relation rel( {types::DataType::INT64, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -453,6 +487,12 @@ TEST_F(ExecGraphTest, two_sequential_limits) { auto exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); ExecutionGraph e; auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), @@ -464,7 +504,7 @@ TEST_F(ExecGraphTest, two_sequential_limits) { std::vector out_col1 = {1, 2}; std::vector out_col2 = {true, false}; std::vector out_col3 = {1.4, 6.2}; - table_store::Table::Cursor cursor(output_table); + table_store::Cursor cursor(output_table); auto out_rb = cursor.GetNextRowBatch({0, 1, 2}).ConsumeValueOrDie(); EXPECT_TRUE(out_rb->ColumnAt(0)->Equals(types::ToArrow(out_col1, arrow::default_memory_pool()))); EXPECT_TRUE(out_rb->ColumnAt(1)->Equals(types::ToArrow(out_col2, arrow::default_memory_pool()))); @@ -490,7 +530,7 @@ TEST_F(ExecGraphTest, execute_with_two_limits) { table_store::schema::Relation rel( {types::DataType::INT64, types::DataType::BOOLEAN, types::DataType::FLOAT64}, {"col1", "col2", "col3"}); - auto table = Table::Create("test", rel); + auto table = table_store::HotColdTable::Create("test", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -516,6 +556,12 @@ TEST_F(ExecGraphTest, execute_with_two_limits) { auto exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); ExecutionGraph e; auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), @@ -526,14 +572,179 @@ TEST_F(ExecGraphTest, execute_with_two_limits) { auto output_table_1 = exec_state_->table_store()->GetTable("output1"); auto output_table_2 = exec_state_->table_store()->GetTable("output2"); std::vector out_in1 = {1.4, 6.2}; - table_store::Table::Cursor cursor1(output_table_1); + table_store::Cursor cursor1(output_table_1); EXPECT_TRUE(cursor1.GetNextRowBatch({2}).ConsumeValueOrDie()->ColumnAt(0)->Equals( types::ToArrow(out_in1, arrow::default_memory_pool()))); - table_store::Table::Cursor cursor2(output_table_2); + table_store::Cursor cursor2(output_table_2); EXPECT_TRUE(cursor2.GetNextRowBatch({2}).ConsumeValueOrDie()->ColumnAt(0)->Equals( types::ToArrow(out_in1, arrow::default_memory_pool()))); } +TEST_F(ExecGraphTest, execute_with_timed_sink_node_no_prior_results_table) { + planpb::PlanFragment pf_pb; + ASSERT_TRUE(TextFormat::MergeFromString(planpb::testutils::kPlanWithOTelExport, &pf_pb)); + std::shared_ptr plan_fragment_ = std::make_shared(1); + ASSERT_OK(plan_fragment_->Init(pf_pb)); + + auto plan_state = std::make_unique(func_registry_.get()); + + auto schema = std::make_shared(); + schema->AddRelation( + 1, table_store::schema::Relation( + std::vector( + {types::DataType::STRING, types::DataType::BOOLEAN, types::DataType::FLOAT64}), + std::vector({"a", "b", "c"}))); + + table_store::schema::Relation rel( + {types::DataType::STRING, types::DataType::BOOLEAN, types::DataType::FLOAT64}, + {"col1", "col2", "col3"}); + auto table = table_store::HotColdTable::Create("test", rel); + + auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); + std::vector col1_in1 = {"service a", "service b", "service c"}; + std::vector col2_in1 = {true, false, true}; + std::vector col3_in1 = {1.4, 6.2, 10.2}; + + EXPECT_OK(rb1.AddColumn(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + EXPECT_OK(rb1.AddColumn(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + EXPECT_OK(rb1.AddColumn(types::ToArrow(col3_in1, arrow::default_memory_pool()))); + EXPECT_OK(table->WriteRowBatch(rb1)); + + auto rb2 = RowBatch(RowDescriptor(rel.col_types()), 2); + std::vector col1_in2 = {"service a", "service b"}; + std::vector col2_in2 = {false, false}; + std::vector col3_in2 = {3.4, 1.2}; + EXPECT_OK(rb2.AddColumn(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + EXPECT_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); + EXPECT_OK(rb2.AddColumn(types::ToArrow(col3_in2, arrow::default_memory_pool()))); + EXPECT_OK(table->WriteRowBatch(rb2)); + + auto table_store = std::make_shared(); + table_store->AddTable("numbers", table); + auto exec_state_ = std::make_unique( + func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, + MockTraceStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); + + ExecutionGraph e; + auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), + /* collect_exec_node_stats */ false); + + EXPECT_OK(e.Execute()); + + auto output_table_1 = exec_state_->table_store()->GetTable("sink_results"); + EXPECT_NE(output_table_1, nullptr); + std::vector out1_in1 = {54}; + std::vector out1_in2 = {54}; + std::vector out1_in3 = {36}; + std::vector out2_in1 = {planpb::OperatorType::MEMORY_SOURCE_OPERATOR}; + std::vector out2_in2 = {planpb::OperatorType::OTEL_EXPORT_SINK_OPERATOR}; + std::vector out2_in3 = {planpb::OperatorType::OTEL_EXPORT_SINK_OPERATOR}; + table_store::Cursor cursor1(output_table_1); + auto rb_out1 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + EXPECT_TRUE(rb_out1->ColumnAt(0)->Equals(types::ToArrow(out1_in1, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out1->ColumnAt(1)->Equals(types::ToArrow(out2_in1, arrow::default_memory_pool()))); + auto rb_out2 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + EXPECT_TRUE(rb_out2->ColumnAt(0)->Equals(types::ToArrow(out1_in2, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out2->ColumnAt(1)->Equals(types::ToArrow(out2_in2, arrow::default_memory_pool()))); + auto rb_out3 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + EXPECT_TRUE(rb_out3->ColumnAt(0)->Equals(types::ToArrow(out1_in3, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out3->ColumnAt(1)->Equals(types::ToArrow(out2_in3, arrow::default_memory_pool()))); +} + +TEST_F(ExecGraphTest, execute_with_timed_sink_node_prior_results_table) { + planpb::PlanFragment pf_pb; + ASSERT_TRUE(TextFormat::MergeFromString(planpb::testutils::kPlanWithOTelExport, &pf_pb)); + std::shared_ptr plan_fragment_ = std::make_shared(1); + ASSERT_OK(plan_fragment_->Init(pf_pb)); + + auto plan_state = std::make_unique(func_registry_.get()); + + auto schema = std::make_shared(); + schema->AddRelation( + 1, table_store::schema::Relation( + std::vector( + {types::DataType::STRING, types::DataType::BOOLEAN, types::DataType::FLOAT64}), + std::vector({"a", "b", "c"}))); + + table_store::schema::Relation rel( + {types::DataType::STRING, types::DataType::BOOLEAN, types::DataType::FLOAT64}, + {"col1", "col2", "col3"}); + auto table = table_store::HotColdTable::Create("test", rel); + + auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); + std::vector col1_in1 = {"service a", "service b", "service c"}; + std::vector col2_in1 = {true, false, true}; + std::vector col3_in1 = {1.4, 6.2, 10.2}; + + EXPECT_OK(rb1.AddColumn(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + EXPECT_OK(rb1.AddColumn(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + EXPECT_OK(rb1.AddColumn(types::ToArrow(col3_in1, arrow::default_memory_pool()))); + EXPECT_OK(table->WriteRowBatch(rb1)); + + auto rb2 = RowBatch(RowDescriptor(rel.col_types()), 2); + std::vector col1_in2 = {"service a", "service b"}; + std::vector col2_in2 = {false, false}; + std::vector col3_in2 = {3.4, 1.2}; + EXPECT_OK(rb2.AddColumn(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + EXPECT_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); + EXPECT_OK(rb2.AddColumn(types::ToArrow(col3_in2, arrow::default_memory_pool()))); + EXPECT_OK(table->WriteRowBatch(rb2)); + + std::vector sink_results_col_names = {"time_", "upid", "bytes_transferred", "destination", + "stream_id"}; + table_store::schema::Relation sink_results_rel( + {types::DataType::TIME64NS, types::DataType::UINT128, types::DataType::INT64, types::DataType::INT64, types::DataType::STRING}, + sink_results_col_names); + auto sink_results_table = table_store::HotColdTable::Create("sink_results", sink_results_rel); + + auto table_store = std::make_shared(); + table_store->AddTable("numbers", table); + table_store->AddTable("sink_results", sink_results_table); + auto exec_state_ = std::make_unique( + func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, + MockTraceStubGenerator, sole::uuid4(), nullptr); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); + + ExecutionGraph e; + auto s = e.Init(schema.get(), plan_state.get(), exec_state_.get(), plan_fragment_.get(), + /* collect_exec_node_stats */ false); + + EXPECT_OK(e.Execute()); + + auto output_table_1 = exec_state_->table_store()->GetTable("sink_results"); + EXPECT_NE(output_table_1, nullptr); + std::vector out1_in1 = {54}; + std::vector out1_in2 = {54}; + std::vector out1_in3 = {36}; + std::vector out2_in1 = {planpb::OperatorType::MEMORY_SOURCE_OPERATOR}; + std::vector out2_in2 = {planpb::OperatorType::OTEL_EXPORT_SINK_OPERATOR}; + std::vector out2_in3 = {planpb::OperatorType::OTEL_EXPORT_SINK_OPERATOR}; + table_store::Cursor cursor1(output_table_1); + auto rb_out1 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + LOG(INFO) << rb_out1->DebugString(); + EXPECT_TRUE(rb_out1->ColumnAt(0)->Equals(types::ToArrow(out1_in1, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out1->ColumnAt(1)->Equals(types::ToArrow(out2_in1, arrow::default_memory_pool()))); + auto rb_out2 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + LOG(INFO) << rb_out2->DebugString(); + EXPECT_TRUE(rb_out2->ColumnAt(0)->Equals(types::ToArrow(out1_in2, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out2->ColumnAt(1)->Equals(types::ToArrow(out2_in2, arrow::default_memory_pool()))); + auto rb_out3 = cursor1.GetNextRowBatch({2, 3}).ConsumeValueOrDie(); + LOG(INFO) << rb_out3->DebugString(); + EXPECT_TRUE(rb_out3->ColumnAt(0)->Equals(types::ToArrow(out1_in3, arrow::default_memory_pool()))); + EXPECT_TRUE(rb_out3->ColumnAt(1)->Equals(types::ToArrow(out2_in3, arrow::default_memory_pool()))); +} + class YieldingExecGraphTest : public BaseExecGraphTest { protected: void SetUp() { SetUpExecState(); } @@ -703,6 +914,12 @@ class GRPCExecGraphTest : public ::testing::Test { exec_state_ = std::make_unique( func_registry_.get(), table_store, MockResultSinkStubGenerator, MockMetricsStubGenerator, MockTraceStubGenerator, MockLogStubGenerator, sole::uuid4(), nullptr, grpc_router_.get()); + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); } void SetUpPlanFragment() { diff --git a/src/carnot/exec/exec_node.h b/src/carnot/exec/exec_node.h index 34c692c61ce..764c865229c 100644 --- a/src/carnot/exec/exec_node.h +++ b/src/carnot/exec/exec_node.h @@ -18,6 +18,7 @@ #pragma once +#include #include #include #include @@ -28,6 +29,18 @@ #include "src/common/perf/perf.h" #include "src/table_store/table_store.h" +namespace px::carnot::exec { +// Forward declaration so enum_range can be specialized. +enum class SinkResultsDestType : uint64_t; + +} // namespace px::carot::exec + +template <> +struct magic_enum::customize::enum_range { + static constexpr int min = 1000; + static constexpr int max = 11000; +}; + namespace px { namespace carnot { namespace exec { @@ -127,10 +140,29 @@ struct ExecNodeStats { absl::flat_hash_map extra_info; }; +enum class SinkResultsDestType : uint64_t { + amqp_events = 10001, // TODO(ddelnano): This is set to not collide with the planpb::OperatorType enum + cql_events, + dns_events, + http_events, + kafka_events, // Won't work since table is suffixed with ".beta" + mongodb_events, + mux_events, + mysql_events, + nats_events, // Won't work since table is suffixed with ".beta" + pgsql_events, + redis_events, +}; + /** * This is the base class for the execution nodes in Carnot. */ class ExecNode { + const std::string kContextKey = "mutation_id"; + const std::string kSinkResultsTableName = "sink_results"; + const std::vector sink_results_col_names = {"time_", "upid", "bytes_transferred", + "destination", "stream_id"}; + public: ExecNode() = delete; virtual ~ExecNode() = default; @@ -143,9 +175,27 @@ class ExecNode { * @return */ Status Init(const plan::Operator& plan_node, - const table_store::schema::RowDescriptor& output_descriptor, - std::vector input_descriptors, - bool collect_exec_stats = false) { + const table_store::schema::RowDescriptor& output_descriptor, + std::vector input_descriptors, + bool collect_exec_stats = false) { + auto op_type = plan_node.op_type(); + // TODO(ddelnano): Replace this with a template based compile time check + // to ensure that there can't be segfaults on the subsequent static_casts + if (op_type == planpb::MEMORY_SOURCE_OPERATOR || op_type == planpb::GRPC_SINK_OPERATOR || + op_type == planpb::MEMORY_SINK_OPERATOR || op_type == planpb::OTEL_EXPORT_SINK_OPERATOR) { + const auto* sink_op = static_cast(&plan_node); + context_ = sink_op->context(); + auto op_type = plan_node.op_type(); + destination_ = static_cast(op_type); + if (op_type == planpb::MEMORY_SOURCE_OPERATOR) { + const auto* memory_source_op = static_cast(&plan_node); + auto table_name = memory_source_op->TableName(); + auto protocol_events = magic_enum::enum_cast(table_name); + if (protocol_events.has_value()) { + destination_ = static_cast(protocol_events.value()); + } + } + } is_initialized_ = true; output_descriptor_ = std::make_unique(output_descriptor); input_descriptors_ = input_descriptors; @@ -160,6 +210,9 @@ class ExecNode { */ Status Prepare(ExecState* exec_state) { DCHECK(is_initialized_); + if (context_.find(kContextKey) != context_.end()) { + SetUpStreamResultsTable(exec_state); + } return PrepareImpl(exec_state); } @@ -211,7 +264,7 @@ class ExecNode { * @return The Status of consumption. */ Status ConsumeNext(ExecState* exec_state, const table_store::schema::RowBatch& rb, - size_t parent_index) { + size_t parent_index) { DCHECK(is_initialized_); DCHECK(type() == ExecNodeType::kSinkNode || type() == ExecNodeType::kProcessingNode); if (rb.eos() && !rb.eow()) { @@ -222,6 +275,8 @@ class ExecNode { stats_->ResumeTotalTimer(); PX_RETURN_IF_ERROR(ConsumeNextImpl(exec_state, rb, parent_index)); stats_->StopTotalTimer(); + PX_RETURN_IF_ERROR( + RecordSinkResults(rb, exec_state->time_now(), exec_state->GetAgentUPID().value())); return Status::OK(); } @@ -282,7 +337,8 @@ class ExecNode { * @param rb The row batch to send. * @return Status of children execution. */ - Status SendRowBatchToChildren(ExecState* exec_state, const table_store::schema::RowBatch& rb) { + Status SendRowBatchToChildren(ExecState* exec_state, + const table_store::schema::RowBatch& rb) { stats_->ResumeChildTimer(); for (size_t i = 0; i < children_.size(); ++i) { PX_RETURN_IF_ERROR(children_[i]->ConsumeNext(exec_state, rb, parent_ids_for_children_[i])); @@ -293,10 +349,16 @@ class ExecNode { DCHECK(!sent_eos_); sent_eos_ = true; } + PX_RETURN_IF_ERROR( + RecordSinkResults(rb, exec_state->time_now(), exec_state->GetAgentUPID().value())); return Status::OK(); } - explicit ExecNode(ExecNodeType type) : type_(type) {} + explicit ExecNode(ExecNodeType type) + : type_(type), + rel_({types::DataType::TIME64NS, types::DataType::UINT128, types::DataType::INT64, + types::DataType::INT64, types::DataType::STRING}, + sink_results_col_names) {} // Defines the protected implementations of the non-virtual interface functions // defined above. @@ -321,6 +383,43 @@ class ExecNode { bool sent_eos_ = false; private: + void SetUpStreamResultsTable(ExecState* exec_state) { + auto sink_results = exec_state->table_store()->GetTable(kSinkResultsTableName); + if (sink_results != nullptr) { + table_ = sink_results; + } else { + auto table = table_store::HotColdTable::Create(kSinkResultsTableName, rel_); + exec_state->table_store()->AddTable(kSinkResultsTableName, table); + table_ = table.get(); + } + } + + Status RecordSinkResults(const table_store::schema::RowBatch& rb, + const types::Time64NSValue time_now, const types::UInt128Value upid) { + if (table_ != nullptr && context_.find(kContextKey) != context_.end()) { + auto mutation_id = context_[kContextKey]; + std::vector col1_in1 = {time_now}; + std::vector col2_in1 = {upid}; + std::vector col3_in1 = {rb.NumBytes()}; + std::vector col4_in1 = {destination_}; + std::vector col5_in1 = {mutation_id}; + auto rb_sink_stats = + table_store::schema::RowBatch(table_store::schema::RowDescriptor(rel_.col_types()), 1); + PX_RETURN_IF_ERROR( + rb_sink_stats.AddColumn(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + PX_RETURN_IF_ERROR( + rb_sink_stats.AddColumn(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + PX_RETURN_IF_ERROR( + rb_sink_stats.AddColumn(types::ToArrow(col3_in1, arrow::default_memory_pool()))); + PX_RETURN_IF_ERROR( + rb_sink_stats.AddColumn(types::ToArrow(col4_in1, arrow::default_memory_pool()))); + PX_RETURN_IF_ERROR( + rb_sink_stats.AddColumn(types::ToArrow(col5_in1, arrow::default_memory_pool()))); + PX_RETURN_IF_ERROR(table_->WriteRowBatch(rb_sink_stats)); + } + return Status::OK(); + } + // The stats of this exec node. std::unique_ptr stats_; // Unowned reference to the children. Must remain valid for the duration of query. @@ -334,6 +433,16 @@ class ExecNode { ExecNodeType type_; // Whether this node has been initialized. bool is_initialized_ = false; + + // The context key, value pairs passed to the operator node. + // This is currently used to store the mutation_id. + std::map context_; + + // The operator type of the current node + uint64_t destination_; + + table_store::Table* table_; + table_store::schema::Relation rel_; }; /** diff --git a/src/carnot/exec/exec_state.h b/src/carnot/exec/exec_state.h index 444d9298d06..2ecb5713918 100644 --- a/src/carnot/exec/exec_state.h +++ b/src/carnot/exec/exec_state.h @@ -73,8 +73,9 @@ class ExecState { udf::Registry* func_registry, std::shared_ptr table_store, const ResultSinkStubGenerator& stub_generator, const MetricsStubGenerator& metrics_stub_generator, - const TraceStubGenerator& trace_stub_generator, const LogsStubGenerator& logs_stub_generator, - const sole::uuid& query_id, udf::ModelPool* model_pool, GRPCRouter* grpc_router = nullptr, + const TraceStubGenerator& trace_stub_generator, + const LogsStubGenerator& logs_stub_generator, const sole::uuid& query_id, + udf::ModelPool* model_pool, GRPCRouter* grpc_router = nullptr, std::function add_auth_func = [](grpc::ClientContext*) {}, ExecMetrics* exec_metrics = nullptr) : func_registry_(func_registry), @@ -87,7 +88,8 @@ class ExecState { model_pool_(model_pool), grpc_router_(grpc_router), add_auth_to_grpc_client_context_func_(add_auth_func), - exec_metrics_(exec_metrics) {} + exec_metrics_(exec_metrics), + time_now_(px::CurrentTimeNS()) {} ~ExecState() { if (grpc_router_ != nullptr) { @@ -211,6 +213,8 @@ class ExecState { metadata_state_ = metadata_state; } + md::UPID GetAgentUPID() const { return metadata_state_->agent_upid(); } + GRPCRouter* grpc_router() { return grpc_router_; } void AddAuthToGRPCClientContext(grpc::ClientContext* ctx) { @@ -220,6 +224,8 @@ class ExecState { ExecMetrics* exec_metrics() { return exec_metrics_; } + types::Time64NSValue time_now() const { return time_now_; } + private: udf::Registry* func_registry_; std::shared_ptr table_store_; diff --git a/src/carnot/exec/grpc_sink_node_benchmark.cc b/src/carnot/exec/grpc_sink_node_benchmark.cc index 96707f0d896..77447969f47 100644 --- a/src/carnot/exec/grpc_sink_node_benchmark.cc +++ b/src/carnot/exec/grpc_sink_node_benchmark.cc @@ -76,7 +76,8 @@ void BM_GRPCSinkNodeSplitting(benchmark::State& state) { px::carnot::exec::GRPCSinkNode node; auto op_proto = px::carnot::planpb::testutils::CreateTestGRPCSink2PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); auto num_rows = 1024; diff --git a/src/carnot/exec/grpc_sink_node_test.cc b/src/carnot/exec/grpc_sink_node_test.cc index 62d6a2e2c12..f4b398ecae4 100644 --- a/src/carnot/exec/grpc_sink_node_test.cc +++ b/src/carnot/exec/grpc_sink_node_test.cc @@ -18,6 +18,7 @@ #include "src/carnot/exec/grpc_sink_node.h" +#include #include #include @@ -162,7 +163,8 @@ query_result { TEST_F(GRPCSinkNodeTest, internal_result) { auto op_proto = planpb::testutils::CreateTestGRPCSink1PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); @@ -294,7 +296,8 @@ query_result { TEST_F(GRPCSinkNodeTest, external_result) { auto op_proto = planpb::testutils::CreateTestGRPCSink2PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); @@ -352,7 +355,8 @@ TEST_F(GRPCSinkNodeTest, external_result) { TEST_F(GRPCSinkNodeTest, check_connection) { auto op_proto = planpb::testutils::CreateTestGRPCSink2PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); @@ -392,7 +396,8 @@ TEST_F(GRPCSinkNodeTest, check_connection) { TEST_F(GRPCSinkNodeTest, update_connection_time) { auto op_proto = planpb::testutils::CreateTestGRPCSink2PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); @@ -444,7 +449,8 @@ class GRPCSinkNodeSplitTest : public GRPCSinkNodeTest, TEST_P(GRPCSinkNodeSplitTest, break_up_batches) { auto op_proto = planpb::testutils::CreateTestGRPCSink1PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); auto test_case = GetParam(); @@ -652,7 +658,8 @@ INSTANTIATE_TEST_SUITE_P(SplitBatchesTest, GRPCSinkNodeSplitTest, TEST_F(GRPCSinkNodeTest, retry_failed_writes) { auto op_proto = planpb::testutils::CreateTestGRPCSink1PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); @@ -724,7 +731,8 @@ TEST_F(GRPCSinkNodeTest, retry_failed_writes) { TEST_F(GRPCSinkNodeTest, check_connection_after_eos) { auto op_proto = planpb::testutils::CreateTestGRPCSink2PB(); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(op_proto.grpc_sink_op()); RowDescriptor input_rd({types::DataType::INT64}); RowDescriptor output_rd({types::DataType::INT64}); diff --git a/src/carnot/exec/memory_sink_node.cc b/src/carnot/exec/memory_sink_node.cc index 6f0fb54c5e9..910b70c3f30 100644 --- a/src/carnot/exec/memory_sink_node.cc +++ b/src/carnot/exec/memory_sink_node.cc @@ -62,7 +62,8 @@ Status MemorySinkNode::PrepareImpl(ExecState* exec_state_) { col_names.push_back(plan_node_->ColumnName(i)); } - table_ = Table::Create(TableName(), Relation(input_descriptor_->types(), col_names)); + table_ = table_store::HotColdTable::Create(TableName(), + Relation(input_descriptor_->types(), col_names)); exec_state_->table_store()->AddTable(plan_node_->TableName(), table_); return Status::OK(); diff --git a/src/carnot/exec/memory_sink_node_test.cc b/src/carnot/exec/memory_sink_node_test.cc index e2587dbf132..a318375b249 100644 --- a/src/carnot/exec/memory_sink_node_test.cc +++ b/src/carnot/exec/memory_sink_node_test.cc @@ -85,7 +85,7 @@ TEST_F(MemorySinkNodeTest, basic) { false, 0); auto table = exec_state_->table_store()->GetTable("cpu_15s"); - table_store::Table::Cursor cursor(table); + table_store::Cursor cursor(table); auto batch_or_s = cursor.GetNextRowBatch({0, 1}); EXPECT_OK(batch_or_s); auto batch = batch_or_s.ConsumeValueOrDie(); @@ -104,7 +104,7 @@ TEST_F(MemorySinkNodeTest, basic) { .Close(); // Update stop spec of the cursor to include the new row batch. - cursor.UpdateStopSpec(table_store::Table::Cursor::StopSpec{}); + cursor.UpdateStopSpec(table_store::Cursor::StopSpec{}); batch_or_s = cursor.GetNextRowBatch({0, 1}); EXPECT_OK(batch_or_s); batch = batch_or_s.ConsumeValueOrDie(); @@ -147,7 +147,7 @@ TEST_F(MemorySinkNodeTest, zero_row_row_batch_not_eos) { .Close(); auto table = exec_state_->table_store()->GetTable("cpu_15s"); - table_store::Table::Cursor cursor(table); + table_store::Cursor cursor(table); auto batch_or_s = cursor.GetNextRowBatch({0, 1}); EXPECT_OK(batch_or_s); auto batch = batch_or_s.ConsumeValueOrDie(); diff --git a/src/carnot/exec/memory_source_node.cc b/src/carnot/exec/memory_source_node.cc index 97ad0513b50..2c9f02df14e 100644 --- a/src/carnot/exec/memory_source_node.cc +++ b/src/carnot/exec/memory_source_node.cc @@ -32,8 +32,8 @@ namespace px { namespace carnot { namespace exec { -using StartSpec = Table::Cursor::StartSpec; -using StopSpec = Table::Cursor::StopSpec; +using StartSpec = table_store::Cursor::StartSpec; +using StopSpec = table_store::Cursor::StopSpec; std::string MemorySourceNode::DebugStringImpl() { return absl::Substitute("Exec::MemorySourceNode: ", plan_node_->TableName(), @@ -85,7 +85,7 @@ Status MemorySourceNode::OpenImpl(ExecState* exec_state) { stop_spec.type = StopSpec::StopType::CurrentEndOfTable; } } - cursor_ = std::make_unique(table_, start_spec, stop_spec); + cursor_ = std::make_unique(table_, start_spec, stop_spec); return Status::OK(); } diff --git a/src/carnot/exec/memory_source_node.h b/src/carnot/exec/memory_source_node.h index ccb059827f3..edbea4375d5 100644 --- a/src/carnot/exec/memory_source_node.h +++ b/src/carnot/exec/memory_source_node.h @@ -60,7 +60,7 @@ class MemorySourceNode : public SourceNode { // Whether this memory source will stream future results. bool streaming_ = false; - std::unique_ptr cursor_; + std::unique_ptr cursor_; std::unique_ptr plan_node_; table_store::Table* table_ = nullptr; diff --git a/src/carnot/exec/memory_source_node_test.cc b/src/carnot/exec/memory_source_node_test.cc index df86c58c23c..418de849ee5 100644 --- a/src/carnot/exec/memory_source_node_test.cc +++ b/src/carnot/exec/memory_source_node_test.cc @@ -59,7 +59,8 @@ class MemorySourceNodeTest : public ::testing::Test { {"col1", "time_"}); int64_t compaction_size = 2 * sizeof(bool) + 2 * sizeof(int64_t); - cpu_table_ = std::make_shared("cpu", rel, 128 * 1024, compaction_size); + cpu_table_ = + std::make_shared("cpu", rel, 128 * 1024, compaction_size); exec_state_->table_store()->AddTable("cpu", cpu_table_); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); @@ -76,7 +77,7 @@ class MemorySourceNodeTest : public ::testing::Test { EXPECT_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); EXPECT_OK(cpu_table_->WriteRowBatch(rb2)); - exec_state_->table_store()->AddTable("empty", Table::Create("empty", rel)); + exec_state_->table_store()->AddTable("empty", table_store::HotColdTable::Create("empty", rel)); } std::shared_ptr
cpu_table_; @@ -237,7 +238,7 @@ class MemorySourceNodeTabletTest : public ::testing::Test { rel = table_store::schema::Relation({types::DataType::BOOLEAN, types::DataType::TIME64NS}, {"col1", "time_"}); - std::shared_ptr
tablet = Table::Create(table_name_, rel); + std::shared_ptr
tablet = table_store::HotColdTable::Create(table_name_, rel); AddValuesToTable(tablet.get()); exec_state_->table_store()->AddTable(tablet, table_name_, table_id_, tablet_id_); @@ -296,7 +297,7 @@ TEST_F(MemorySourceNodeTabletTest, basic_tablet_test) { TEST_F(MemorySourceNodeTabletTest, multiple_tablet_test) { types::TabletID new_tablet_id = "456"; EXPECT_NE(tablet_id_, new_tablet_id); - std::shared_ptr
new_tablet = Table::Create(tablet_id_, rel); + std::shared_ptr
new_tablet = table_store::HotColdTable::Create(tablet_id_, rel); auto wrapper_batch_1 = std::make_unique(); auto col_wrapper_1 = std::make_shared(0); @@ -458,7 +459,8 @@ class ParamMemorySourceNodeTest : public ::testing::Test, std::vector{types::DataType::TIME64NS}, std::vector{"time_"}); int64_t compaction_size = 2 * sizeof(int64_t); - cpu_table_ = std::make_shared
("cpu", *rel_, 128 * 1024, compaction_size); + cpu_table_ = + std::make_shared("cpu", *rel_, 128 * 1024, compaction_size); exec_state_->table_store()->AddTable("cpu", cpu_table_); planpb::Operator op; diff --git a/src/carnot/exec/otel_export_sink_node.cc b/src/carnot/exec/otel_export_sink_node.cc index 77da9f12d0b..3ba8ec2a297 100644 --- a/src/carnot/exec/otel_export_sink_node.cc +++ b/src/carnot/exec/otel_export_sink_node.cc @@ -465,7 +465,8 @@ Status OTelExportSinkNode::ConsumeLogs(ExecState* exec_state, const RowBatch& rb AddAttributes(log->mutable_attributes(), log_pb.attributes(), rb, row_idx); auto time_col = rb.ColumnAt(log_pb.time_column_index()).get(); - log->set_time_unix_nano(types::GetValueFromArrowArray(time_col, row_idx)); + log->set_time_unix_nano( + types::GetValueFromArrowArray(time_col, row_idx)); if (log_pb.observed_time_column_index() >= 0) { auto observed_time_col = rb.ColumnAt(log_pb.observed_time_column_index()).get(); log->set_observed_time_unix_nano( diff --git a/src/carnot/exec/otel_export_sink_node_test.cc b/src/carnot/exec/otel_export_sink_node_test.cc index 9aeee55103e..37ebfe3ea5b 100644 --- a/src/carnot/exec/otel_export_sink_node_test.cc +++ b/src/carnot/exec/otel_export_sink_node_test.cc @@ -42,6 +42,7 @@ #include "src/carnot/planpb/plan.pb.h" #include "src/carnot/planpb/test_proto.h" #include "src/carnot/udf/registry.h" +#include "src/common/testing/event/simulated_time_system.h" #include "src/common/testing/testing.h" #include "src/common/uuid/uuid_utils.h" #include "src/shared/types/types.h" @@ -101,6 +102,14 @@ class OTelExportSinkNodeTest : public ::testing::Test { return std::move(logs_mock_unique_); }, sole::uuid4(), nullptr, nullptr, [](grpc::ClientContext*) {}); + + auto time_system = std::make_unique( + std::chrono::steady_clock::now(), std::chrono::system_clock::now()); + + auto metadata_state = std::make_shared( + "myhost", 1, 963, 0, sole::uuid4(), "mypod", sole::uuid4(), "myvizier", "myviziernamespace", + time_system.get()); + exec_state_->set_metadata_state(metadata_state); } protected: @@ -136,7 +145,8 @@ metrics { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_pb_txt, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); RowDescriptor input_rd({types::TIME64NS, types::FLOAT64}); RowDescriptor output_rd({}); @@ -185,7 +195,8 @@ metrics { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_pb_txt, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); RowDescriptor input_rd({types::TIME64NS, types::FLOAT64, types::STRING}); RowDescriptor output_rd({}); @@ -250,7 +261,8 @@ TEST_P(OTelMetricsTest, process_data) { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(tc.operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); // Load a RowBatch to get the Input RowDescriptor. @@ -1033,7 +1045,8 @@ TEST_P(OTelSpanTest, process_data) { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(tc.operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); // Load a RowBatch to get the Input RowDescriptor. @@ -1530,7 +1543,8 @@ TEST_P(SpanIDTests, generate_ids) { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(tc.operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); // Load a RowBatch to get the Input RowDescriptor. @@ -1686,7 +1700,8 @@ spans { parent_span_id_column_index: -1 })pb"; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); std::string row_batch = R"pb( cols { time64ns_data { data: 10 data: 20 } } @@ -1724,7 +1739,8 @@ metrics { gauge { int_column_index: 1 } })pb"; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); std::string row_batch = R"pb( cols { time64ns_data { data: 10 data: 11 } } @@ -1774,7 +1790,8 @@ spans { parent_span_id_column_index: -1 })pb"; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); std::string row_batch = R"pb( cols { time64ns_data { data: 10 data: 20 } } @@ -1825,7 +1842,8 @@ metrics { gauge { int_column_index: 1 } })pb"; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); std::string row_batch = R"pb( cols { time64ns_data { data: 10 data: 11 } } @@ -1871,7 +1889,8 @@ TEST_P(OTelLogTest, process_data) { planpb::OTelExportSinkOperator otel_sink_op; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(tc.operator_proto, &otel_sink_op)); - auto plan_node = std::make_unique(1); + std::map context; + auto plan_node = std::make_unique(1, context); auto s = plan_node->Init(otel_sink_op); // Load a RowBatch to get the Input RowDescriptor. diff --git a/src/carnot/exec/test_utils.h b/src/carnot/exec/test_utils.h index e2f6fae1289..e0958eaf8df 100644 --- a/src/carnot/exec/test_utils.h +++ b/src/carnot/exec/test_utils.h @@ -122,7 +122,7 @@ class CarnotTestUtils { static std::shared_ptr TestTable() { table_store::schema::Relation rel({types::DataType::FLOAT64, types::DataType::INT64}, {"col1", "col2"}); - auto table = table_store::Table::Create("test_table", rel); + auto table = table_store::HotColdTable::Create("test_table", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {0.5, 1.2, 5.3}; @@ -143,7 +143,7 @@ class CarnotTestUtils { static std::shared_ptr TestDuration64Table() { table_store::schema::Relation rel({types::DataType::INT64}, {"col1"}); - auto table = table_store::Table::Create("test_table", rel); + auto table = table_store::HotColdTable::Create("test_table", rel); auto rb1 = RowBatch(RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {1, 2, 3}; @@ -166,7 +166,7 @@ class CarnotTestUtils { types::DataType::INT64, types::DataType::STRING}, {"time_", "col2", "col3", "num_groups", "string_groups"}); - auto table = table_store::Table::Create("test_table", rel); + auto table = table_store::HotColdTable::Create("test_table", rel); for (const auto& pair : split_idx) { auto rb = RowBatch(RowDescriptor(rel.col_types()), pair.second - pair.first); @@ -227,7 +227,7 @@ class CarnotTestUtils { "read_bytes", "write_bytes", }); - auto table = table_store::Table::Create("process_table", rel); + auto table = table_store::HotColdTable::Create("process_table", rel); return table; } @@ -248,7 +248,7 @@ class CarnotTestUtils { "req_path", "req_body", "req_body_size", "resp_headers", "resp_status", "resp_message", "resp_body", "resp_body_size", "latency", }); - auto table = table_store::Table::Create("http_events_table", rel); + auto table = table_store::HotColdTable::Create("http_events_table", rel); return table; } }; diff --git a/src/carnot/funcs/builtins/builtins.cc b/src/carnot/funcs/builtins/builtins.cc index f871244bdaf..5f4b941c9b9 100644 --- a/src/carnot/funcs/builtins/builtins.cc +++ b/src/carnot/funcs/builtins/builtins.cc @@ -25,6 +25,7 @@ #include "src/carnot/funcs/builtins/ml_ops.h" #include "src/carnot/funcs/builtins/pii_ops.h" #include "src/carnot/funcs/builtins/pprof_ops.h" +#include "src/carnot/funcs/builtins/pipeline_ops.h" #include "src/carnot/funcs/builtins/regex_ops.h" #include "src/carnot/funcs/builtins/request_path_ops.h" #include "src/carnot/funcs/builtins/sql_ops.h" @@ -52,6 +53,7 @@ void RegisterBuiltinsOrDie(udf::Registry* registry) { RegisterPIIOpsOrDie(registry); RegisterURIOpsOrDie(registry); RegisterUtilOpsOrDie(registry); + RegisterPipelineOpsOrDie(registry); RegisterPProfOpsOrDie(registry); } diff --git a/src/carnot/funcs/builtins/pipeline_ops.cc b/src/carnot/funcs/builtins/pipeline_ops.cc new file mode 100644 index 00000000000..8528ad6dd29 --- /dev/null +++ b/src/carnot/funcs/builtins/pipeline_ops.cc @@ -0,0 +1,39 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#include + +#include +#include "src/carnot/funcs/builtins/pipeline_ops.h" + +namespace px { +namespace carnot { +namespace builtins { + +void RegisterPipelineOpsOrDie(udf::Registry* registry) { + CHECK(registry != nullptr); + /***************************************** + * Scalar UDFs. + *****************************************/ + registry->RegisterOrDie("pipeline_dest_to_name"); +} + +} // namespace builtins +} // namespace carnot +} // namespace px diff --git a/src/carnot/funcs/builtins/pipeline_ops.h b/src/carnot/funcs/builtins/pipeline_ops.h new file mode 100644 index 00000000000..eb479d4a083 --- /dev/null +++ b/src/carnot/funcs/builtins/pipeline_ops.h @@ -0,0 +1,83 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +#include "src/carnot/udf/registry.h" +#include "src/common/base/utils.h" +#include "src/shared/types/types.h" + +namespace px::carnot::builtins { +// Forward declaration so enum_range can be specialized. +enum class SinkResultsDestType : uint64_t; + +} // namespace px::carot::builtins + +template <> +struct magic_enum::customize::enum_range { + static constexpr int min = 1000; + static constexpr int max = 11000; +}; + + +namespace px { +namespace carnot { +namespace builtins { + +enum class SinkResultsDestType : uint64_t { + grpc_sink = 9100, + otel_export = 9200, + amqp_events = 10001, // TODO(ddelnano): This is set to not collide with the planpb::OperatorType enum + cql_events, + dns_events, + http_events, + kafka_events, // Won't work since table is suffixed with ".beta" + mongodb_events, + mux_events, + mysql_events, + nats_events, // Won't work since table is suffixed with ".beta" + pgsql_events, + redis_events, +}; + +class PipelineDestToName : public udf::ScalarUDF { + public: + StringValue Exec(FunctionContext*, Int64Value input) { + auto protocol_events = magic_enum::enum_cast(input.val); + if (!protocol_events.has_value()) { + return "unknown"; + } + return std::string(magic_enum::enum_name(protocol_events.value())); + } + + static udf::ScalarUDFDocBuilder Doc() { + return udf::ScalarUDFDocBuilder( + "Convert the destination ID from the sink_results table to a human-readable name.") + .Details("TBD") + .Example(R"doc( +df = px.DataFrame("sink_results) +df.dest = px.pipeline_dest_to_name(df.destination))doc") + .Arg("dest", "The destination enum to covert.") + .Returns("The human-readable name of the destination."); + } +}; + +void RegisterPipelineOpsOrDie(udf::Registry* registry); + +} // namespace builtins +} // namespace carnot +} // namespace px diff --git a/src/carnot/plan/operators.cc b/src/carnot/plan/operators.cc index bfdb43427f4..42f19f98033 100644 --- a/src/carnot/plan/operators.cc +++ b/src/carnot/plan/operators.cc @@ -45,6 +45,20 @@ namespace plan { using px::Status; +// enable_if std::is_base_of_v +template >> +std::unique_ptr CreateOperator(int64_t id, const TProto& pb, + std::map context) { + auto op = std::make_unique(id, context); + auto s = op->Init(pb); + // On init failure, return null; + if (!s.ok()) { + LOG(ERROR) << "Failed to initialize operator with err: " << s.msg(); + return nullptr; + } + return op; +} + template std::unique_ptr CreateOperator(int64_t id, const TProto& pb) { auto op = std::make_unique(id); @@ -58,19 +72,21 @@ std::unique_ptr CreateOperator(int64_t id, const TProto& pb) { } std::unique_ptr Operator::FromProto(const planpb::Operator& pb, int64_t id) { + auto pb_context = pb.context(); + std::map context(pb_context.begin(), pb_context.end()); switch (pb.op_type()) { case planpb::MEMORY_SOURCE_OPERATOR: - return CreateOperator(id, pb.mem_source_op()); + return CreateOperator(id, pb.mem_source_op(), context); case planpb::MAP_OPERATOR: return CreateOperator(id, pb.map_op()); case planpb::AGGREGATE_OPERATOR: return CreateOperator(id, pb.agg_op()); case planpb::MEMORY_SINK_OPERATOR: - return CreateOperator(id, pb.mem_sink_op()); + return CreateOperator(id, pb.mem_sink_op(), context); case planpb::GRPC_SOURCE_OPERATOR: return CreateOperator(id, pb.grpc_source_op()); case planpb::GRPC_SINK_OPERATOR: - return CreateOperator(id, pb.grpc_sink_op()); + return CreateOperator(id, pb.grpc_sink_op(), context); case planpb::FILTER_OPERATOR: return CreateOperator(id, pb.filter_op()); case planpb::LIMIT_OPERATOR: @@ -84,7 +100,7 @@ std::unique_ptr Operator::FromProto(const planpb::Operator& pb, int64_ case planpb::EMPTY_SOURCE_OPERATOR: return CreateOperator(id, pb.empty_source_op()); case planpb::OTEL_EXPORT_SINK_OPERATOR: - return CreateOperator(id, pb.otel_sink_op()); + return CreateOperator(id, pb.otel_sink_op(), context); default: LOG(FATAL) << absl::Substitute("Unknown operator type: $0", magic_enum::enum_name(pb.op_type())); diff --git a/src/carnot/plan/operators.h b/src/carnot/plan/operators.h index 8586f6eb976..9a12712e264 100644 --- a/src/carnot/plan/operators.h +++ b/src/carnot/plan/operators.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -80,9 +81,30 @@ class Operator : public PlanNode { bool is_initialized_ = false; }; -class MemorySourceOperator : public Operator { +class SinkOperator : public Operator { public: - explicit MemorySourceOperator(int64_t id) : Operator(id, planpb::MEMORY_SOURCE_OPERATOR) {} + explicit SinkOperator(int64_t id, planpb::OperatorType op_type, + std::map context) + : Operator(id, op_type), context_(context) {} + + std::string DebugString() const override { return absl::StrCat("SinkOperator: ", id_); } + + StatusOr OutputRelation( + const table_store::schema::Schema& /*schema*/, const PlanState& /*state*/, + const std::vector& /*input_ids*/) const override { + return error::Unimplemented("Derived sink operator must implement OutputRelation"); + } + + std::map context() const { return context_; } + + protected: + std::map context_; +}; + +class MemorySourceOperator : public SinkOperator { + public: + explicit MemorySourceOperator(int64_t id, std::map context) + : SinkOperator(id, planpb::MEMORY_SOURCE_OPERATOR, context) {} ~MemorySourceOperator() override = default; StatusOr OutputRelation( const table_store::schema::Schema& schema, const PlanState& state, @@ -153,9 +175,10 @@ class AggregateOperator : public Operator { planpb::AggregateOperator pb_; }; -class MemorySinkOperator : public Operator { +class MemorySinkOperator : public SinkOperator { public: - explicit MemorySinkOperator(int64_t id) : Operator(id, planpb::MEMORY_SINK_OPERATOR) {} + explicit MemorySinkOperator(int64_t id, std::map context) + : SinkOperator(id, planpb::MEMORY_SINK_OPERATOR, context) {} ~MemorySinkOperator() override = default; StatusOr OutputRelation( @@ -185,9 +208,10 @@ class GRPCSourceOperator : public Operator { planpb::GRPCSourceOperator pb_; }; -class GRPCSinkOperator : public Operator { +class GRPCSinkOperator : public SinkOperator { public: - explicit GRPCSinkOperator(int64_t id) : Operator(id, planpb::GRPC_SINK_OPERATOR) {} + explicit GRPCSinkOperator(int64_t id, std::map context) + : SinkOperator(id, planpb::GRPC_SINK_OPERATOR, context) {} ~GRPCSinkOperator() override = default; StatusOr OutputRelation( @@ -359,9 +383,10 @@ class EmptySourceOperator : public Operator { std::vector column_idxs_; }; -class OTelExportSinkOperator : public Operator { +class OTelExportSinkOperator : public SinkOperator { public: - explicit OTelExportSinkOperator(int64_t id) : Operator(id, planpb::OTEL_EXPORT_SINK_OPERATOR) {} + explicit OTelExportSinkOperator(int64_t id, std::map context) + : SinkOperator(id, planpb::OTEL_EXPORT_SINK_OPERATOR, context) {} ~OTelExportSinkOperator() override = default; StatusOr OutputRelation( diff --git a/src/carnot/planner/cgo_export.cc b/src/carnot/planner/cgo_export.cc index cc80e3cc438..211292d251f 100644 --- a/src/carnot/planner/cgo_export.cc +++ b/src/carnot/planner/cgo_export.cc @@ -126,21 +126,21 @@ char* PlannerCompileMutations(PlannerPtr planner_ptr, const char* mutation_reque auto planner = reinterpret_cast(planner_ptr); - auto dynamic_trace_or_s = planner->CompileTrace(mutation_request_pb); - if (!dynamic_trace_or_s.ok()) { - return ExitEarly(dynamic_trace_or_s.status(), resultLen); + auto mutations_ir_or_s = planner->CompileTrace(mutation_request_pb); + if (!mutations_ir_or_s.ok()) { + return ExitEarly(mutations_ir_or_s.status(), resultLen); } - std::unique_ptr trace = - dynamic_trace_or_s.ConsumeValueOrDie(); + std::unique_ptr mutations = + mutations_ir_or_s.ConsumeValueOrDie(); // If the response is ok, then we can go ahead and set this up. CompileMutationsResponse mutations_response_pb; - WrapStatus(&mutations_response_pb, dynamic_trace_or_s.status()); + WrapStatus(&mutations_response_pb, mutations_ir_or_s.status()); PLANNER_RETURN_IF_ERROR(CompileMutationsResponse, resultLen, - trace->ToProto(&mutations_response_pb)); + mutations->ToProto(&mutations_response_pb)); - // Serialize the tracing program into bytes. + // Serialize the mutations into bytes. return PrepareResult(&mutations_response_pb, resultLen); } diff --git a/src/carnot/planner/cgo_export_test.cc b/src/carnot/planner/cgo_export_test.cc index eed16a9a972..9abace0d86a 100644 --- a/src/carnot/planner/cgo_export_test.cc +++ b/src/carnot/planner/cgo_export_test.cc @@ -278,6 +278,43 @@ TEST_F(PlannerExportTest, compile_delete_tracepoint) { EXPECT_THAT(mutations_response_pb, EqualsProto(kExpectedDeleteTracepointsMutationPb)); } +constexpr char kSingleFileSource[] = R"pxl( +import pxlog + +glob_pattern = 'test.json' +pxlog.FileSource(glob_pattern, 'test_table', '5m') +)pxl"; + +constexpr char kSingleFileSourceProgramPb[] = R"pxl( +glob_pattern: "test.json" +table_name: "test_table" +ttl { + seconds: 300 +} +)pxl"; + +TEST_F(PlannerExportTest, compile_file_source_def) { + planner_ = MakePlanner(); + int result_len; + std::string mutation_request; + plannerpb::CompileMutationsRequest req; + req.set_query_str(kSingleFileSource); + *(req.mutable_logical_planner_state()) = testutils::CreateTwoPEMsOneKelvinPlannerState(); + ASSERT_TRUE(req.SerializeToString(&mutation_request)); + auto interface_result = PlannerCompileMutations(planner_, mutation_request.c_str(), + mutation_request.length(), &result_len); + + ASSERT_GT(result_len, 0); + plannerpb::CompileMutationsResponse mutations_response_pb; + ASSERT_TRUE(mutations_response_pb.ParseFromString( + std::string(interface_result, interface_result + result_len))); + delete[] interface_result; + ASSERT_OK(mutations_response_pb.status()); + ASSERT_EQ(mutations_response_pb.mutations().size(), 1); + EXPECT_THAT(mutations_response_pb.mutations()[0].file_source(), + EqualsProto(kSingleFileSourceProgramPb)); +} + constexpr char kExportPxL[] = R"pxl(import px otel_df = 'placeholder' df = px.DataFrame('http_events', start_time='-5m') diff --git a/src/carnot/planner/compiler/BUILD.bazel b/src/carnot/planner/compiler/BUILD.bazel index 1298c0775a9..359d3518227 100644 --- a/src/carnot/planner/compiler/BUILD.bazel +++ b/src/carnot/planner/compiler/BUILD.bazel @@ -40,6 +40,7 @@ pl_cc_library( "//src/carnot/planner/compiler/optimizer:cc_library", "//src/carnot/planner/compiler_error_context:cc_library", "//src/carnot/planner/compiler_state:cc_library", + "//src/carnot/planner/file_source:cc_library", "//src/carnot/planner/ir:cc_library", "//src/carnot/planner/metadata:cc_library", "//src/carnot/planner/objects:cc_library", diff --git a/src/carnot/planner/compiler/ast_visitor.cc b/src/carnot/planner/compiler/ast_visitor.cc index 0047815780c..a4bfe1eb071 100644 --- a/src/carnot/planner/compiler/ast_visitor.cc +++ b/src/carnot/planner/compiler/ast_visitor.cc @@ -104,6 +104,8 @@ Status ASTVisitorImpl::SetupModules( PixieModule::Create(ir_graph_, compiler_state_, this, func_based_exec_, reserved_names_)); PX_ASSIGN_OR_RETURN((*module_handler_)[TraceModule::kTraceModuleObjName], TraceModule::Create(mutations_, this)); + PX_ASSIGN_OR_RETURN((*module_handler_)[LogModule::kLogModuleObjName], + LogModule::Create(mutations_, this)); PX_ASSIGN_OR_RETURN((*module_handler_)[ConfigModule::kConfigModuleObjName], ConfigModule::Create(mutations_, this)); for (const auto& [module_name, module_text] : module_name_to_pxl_map) { diff --git a/src/carnot/planner/compiler/ast_visitor.h b/src/carnot/planner/compiler/ast_visitor.h index 7d10e93a6ae..7984698ecb5 100644 --- a/src/carnot/planner/compiler/ast_visitor.h +++ b/src/carnot/planner/compiler/ast_visitor.h @@ -33,6 +33,7 @@ #include "src/carnot/funcs/builtins/math_ops.h" #include "src/carnot/planner/ast/ast_visitor.h" #include "src/carnot/planner/compiler_state/compiler_state.h" +#include "src/carnot/planner/file_source/log_module.h" #include "src/carnot/planner/ir/ast_utils.h" #include "src/carnot/planner/ir/ir.h" #include "src/carnot/planner/objects/dataframe.h" diff --git a/src/carnot/planner/compiler/graph_comparison.h b/src/carnot/planner/compiler/graph_comparison.h index c6f75b92037..5e0f8a5641c 100644 --- a/src/carnot/planner/compiler/graph_comparison.h +++ b/src/carnot/planner/compiler/graph_comparison.h @@ -261,7 +261,7 @@ struct PlanGraphMatcher { } virtual void DescribeTo(::std::ostream* os) const { - *os << "equals to text probobuf: " << expected_plan_.DebugString(); + *os << "equals to text protobuf: " << expected_plan_.DebugString(); } virtual void DescribeNegationTo(::std::ostream* os) const { diff --git a/src/carnot/planner/compiler/test_utils.h b/src/carnot/planner/compiler/test_utils.h index 2f65f616b50..616fb8593d8 100644 --- a/src/carnot/planner/compiler/test_utils.h +++ b/src/carnot/planner/compiler/test_utils.h @@ -768,6 +768,14 @@ class OperatorTests : public ::testing::Test { types::DataType::FLOAT64, types::DataType::FLOAT64}), std::vector({"count", "cpu0", "cpu1", "cpu2"})); } + // Used for testing propagation of context to children. + table_store::schema::Relation MakeRelationWithMutation() { + std::optional mutation = "mutation"; + return table_store::schema::Relation( + std::vector({types::DataType::INT64, types::DataType::FLOAT64, + types::DataType::FLOAT64, types::DataType::FLOAT64}), + std::vector({"count", "cpu0", "cpu1", "cpu2"}), mutation); + } // Same as MakeRelation, but has a time column. table_store::schema::Relation MakeTimeRelation() { return table_store::schema::Relation( diff --git a/src/carnot/planner/distributed/coordinator/coordinator.cc b/src/carnot/planner/distributed/coordinator/coordinator.cc index b437bdf8c37..ef468fbe130 100644 --- a/src/carnot/planner/distributed/coordinator/coordinator.cc +++ b/src/carnot/planner/distributed/coordinator/coordinator.cc @@ -194,8 +194,15 @@ StatusOr> CoordinatorImpl::CoordinateImpl(const remote_carnot->AddPlan(remote_plan); distributed_plan->AddPlan(std::move(remote_plan_uptr)); + auto remote_agent_id = remote_carnot->carnot_info().agent_id(); std::vector source_node_ids; for (const auto& [i, data_store_info] : Enumerate(data_store_nodes_)) { + auto agent_id = data_store_info.agent_id(); + // For cases where the remote agent also has a data store, we don't need to add a source. + // This ensures that the MemorySource will be executed locally without an unnecessary GRPCSink/Source pair. + if (agent_id == remote_agent_id) { + continue; + } PX_ASSIGN_OR_RETURN(int64_t source_node_id, distributed_plan->AddCarnot(data_store_info)); distributed_plan->AddEdge(source_node_id, remote_node_id); source_node_ids.push_back(source_node_id); diff --git a/src/carnot/planner/distributed/coordinator/coordinator_test.cc b/src/carnot/planner/distributed/coordinator/coordinator_test.cc index e864338b88b..b6466be90fe 100644 --- a/src/carnot/planner/distributed/coordinator/coordinator_test.cc +++ b/src/carnot/planner/distributed/coordinator/coordinator_test.cc @@ -62,6 +62,16 @@ class CoordinatorTest : public testutils::DistributedRulesTest { ASSERT_OK(rule.Execute(graph.get())); } + void MakeGraphWithMutation() { + auto mem_src = MakeMemSource(MakeRelationWithMutation()); + compiler_state_->relation_map()->emplace("table", MakeRelationWithMutation()); + graph->RecordMutationId({"mutation"}); + MakeMemSink(mem_src, "out"); + + ResolveTypesRule rule(compiler_state_.get()); + ASSERT_OK(rule.Execute(graph.get())); + } + void VerifyHasDataSourcePlan(IR* plan) { auto mem_src_nodes = plan->FindNodesOfType(IRNodeType::kMemorySource); ASSERT_EQ(mem_src_nodes.size(), 1); @@ -144,6 +154,48 @@ TEST_F(CoordinatorTest, three_pems_one_kelvin) { } } +// TODO(ddelnano): Finish this test +TEST_F(CoordinatorTest, three_pems_one_kelvin_with_mut) { + auto ps = LoadDistributedStatePb(kThreePEMsOneKelvinDistributedState); + auto coordinator = Coordinator::Create(compiler_state_.get(), ps).ConsumeValueOrDie(); + + MakeGraphWithMutation(); + auto physical_plan = coordinator->Coordinate(graph.get()).ConsumeValueOrDie(); + + auto topo_sort = physical_plan->dag().TopologicalSort(); + // Last item should be kelvin, id 0. + ASSERT_EQ(topo_sort.size(), 4); + ASSERT_EQ(topo_sort[3], 0); + + auto kelvin_instance = physical_plan->Get(0); + EXPECT_THAT(kelvin_instance->carnot_info().query_broker_address(), ContainsRegex("kelvin")); + { + SCOPED_TRACE("three pems one kelvin -> " + + kelvin_instance->carnot_info().query_broker_address()); + VerifyKelvinMergerPlan(kelvin_instance->plan()); + } + + // Agents are 1,2,3. + for (int64_t i = 1; i <= 3; ++i) { + auto pem_instance = physical_plan->Get(i); + SCOPED_TRACE("three pems one kelvin -> " + pem_instance->carnot_info().query_broker_address()); + EXPECT_THAT(pem_instance->carnot_info().query_broker_address(), ContainsRegex("pem")); + auto plan = pem_instance->plan(); + VerifyPEMPlan(plan); + + auto grpc_sink = plan->FindNodesOfType(IRNodeType::kGRPCSink); + + EXPECT_EQ(1, grpc_sink.size()); + planpb::Operator op; + auto grpc_sink_ir = static_cast(grpc_sink[0]); + // This unit test doesn't trigger the UpdateSink/AddDestinationIDMap code path, so trigger + // manually so the internal GRPC sink ToProto function works. + grpc_sink_ir->AddDestinationIDMap(0, i); + EXPECT_OK(grpc_sink_ir->ToProto(&op, i)); + EXPECT_EQ(1, op.context().size()); + } +} + TEST_F(CoordinatorTest, one_pem_three_kelvin) { auto ps = LoadDistributedStatePb(kOnePEMThreeKelvinsDistributedState); auto coordinator = Coordinator::Create(compiler_state_.get(), ps).ConsumeValueOrDie(); @@ -157,14 +209,39 @@ TEST_F(CoordinatorTest, one_pem_three_kelvin) { auto kelvin_instance = physical_plan->Get(0); EXPECT_THAT(kelvin_instance->carnot_info().query_broker_address(), ContainsRegex("kelvin")); { - SCOPED_TRACE("one pem one kelvin -> kelvin plan"); + SCOPED_TRACE("one pem three kelvin -> kelvin plan"); + VerifyKelvinMergerPlan(kelvin_instance->plan()); + } + + auto pem_instance = physical_plan->Get(1); + EXPECT_THAT(pem_instance->carnot_info().query_broker_address(), ContainsRegex("pem")); + { + SCOPED_TRACE("one pem three kelvin -> pem plan"); + VerifyPEMPlan(pem_instance->plan()); + } +} + +TEST_F(CoordinatorTest, three_pem_one_kelvin_all_has_data_store) { + auto ps = LoadDistributedStatePb(testutils::kThreePEMsOneKelvinAllHasDataStoreDistributedState); + auto coordinator = Coordinator::Create(compiler_state_.get(), ps).ConsumeValueOrDie(); + + MakeGraph(); + + auto physical_plan = coordinator->Coordinate(graph.get()).ConsumeValueOrDie(); + ASSERT_EQ(physical_plan->dag().nodes().size(), 5UL); + /* EXPECT_THAT(physical_plan->dag().TopologicalSort(), ElementsAre(3, 1, 2, 4, 0)); */ + + auto kelvin_instance = physical_plan->Get(0); + EXPECT_THAT(kelvin_instance->carnot_info().query_broker_address(), ContainsRegex("kelvin")); + { + SCOPED_TRACE("one pem three kelvin -> kelvin plan"); VerifyKelvinMergerPlan(kelvin_instance->plan()); } auto pem_instance = physical_plan->Get(1); EXPECT_THAT(pem_instance->carnot_info().query_broker_address(), ContainsRegex("pem")); { - SCOPED_TRACE("one pem one kelvin -> pem plan"); + SCOPED_TRACE("one pem three kelvin -> pem plan"); VerifyPEMPlan(pem_instance->plan()); } } diff --git a/src/carnot/planner/distributed/coordinator/prune_unavailable_sources_rule.cc b/src/carnot/planner/distributed/coordinator/prune_unavailable_sources_rule.cc index 1af0e858da8..3b5b2f85dc1 100644 --- a/src/carnot/planner/distributed/coordinator/prune_unavailable_sources_rule.cc +++ b/src/carnot/planner/distributed/coordinator/prune_unavailable_sources_rule.cc @@ -73,8 +73,7 @@ StatusOr PruneUnavailableSourcesRule::MaybePruneMemorySource(MemorySourceI } bool PruneUnavailableSourcesRule::AgentSupportsMemorySources() { - return carnot_info_.has_data_store() && !carnot_info_.has_grpc_server() && - carnot_info_.processes_data(); + return carnot_info_.has_data_store() && carnot_info_.processes_data(); } bool PruneUnavailableSourcesRule::AgentHasTable(std::string table_name) { diff --git a/src/carnot/planner/distributed/distributed_plan/distributed_plan.cc b/src/carnot/planner/distributed/distributed_plan/distributed_plan.cc index 7fe66c7da83..2226005fabe 100644 --- a/src/carnot/planner/distributed/distributed_plan/distributed_plan.cc +++ b/src/carnot/planner/distributed/distributed_plan/distributed_plan.cc @@ -50,6 +50,10 @@ StatusOr DistributedPlan::ToProto() const { dest->set_grpc_address(exec_complete_address_); dest->set_ssl_targetname(exec_complete_ssl_targetname_); } + if (qb_address_to_plan_pb->find(carnot->QueryBrokerAddress()) != + qb_address_to_plan_pb->end()) { + return error::Internal(absl::Substitute("Distributed plan has multiple nodes with the '$0' query broker address.", carnot->QueryBrokerAddress())); + } (*qb_address_to_plan_pb)[carnot->QueryBrokerAddress()] = plan_proto; (*qb_address_to_dag_id_pb)[carnot->QueryBrokerAddress()] = i; diff --git a/src/carnot/planner/distributed/distributed_planner_test.cc b/src/carnot/planner/distributed/distributed_planner_test.cc index 28fee3533a3..fa4b0a8d0b7 100644 --- a/src/carnot/planner/distributed/distributed_planner_test.cc +++ b/src/carnot/planner/distributed/distributed_planner_test.cc @@ -213,6 +213,78 @@ TEST_F(DistributedPlannerTest, three_agents_one_kelvin) { EXPECT_THAT(grpc_sink_destinations, UnorderedElementsAreArray(grpc_source_ids)); } +TEST_F(DistributedPlannerTest, three_agents_with_participating_kelvin) { + auto mem_src = MakeMemSource(MakeRelation()); + compiler_state_->relation_map()->emplace("table", MakeRelation()); + MakeMemSink(mem_src, "out"); + + ResolveTypesRule rule(compiler_state_.get()); + ASSERT_OK(rule.Execute(graph.get())); + + distributedpb::DistributedState ps_pb = + LoadDistributedStatePb(testutils::kThreePEMsOneKelvinAllHasDataStoreDistributedState); + std::unique_ptr physical_planner = + DistributedPlanner::Create().ConsumeValueOrDie(); + std::unique_ptr physical_plan = + physical_planner->Plan(ps_pb, compiler_state_.get(), graph.get()).ConsumeValueOrDie(); + + ASSERT_OK(physical_plan->ToProto()); + auto topo_sort = physical_plan->dag().TopologicalSort(); + // Last item should be kelvin, id 0. + ASSERT_EQ(topo_sort.size(), 4); + ASSERT_EQ(topo_sort[3], 0); + + std::vector grpc_sink_destinations; + absl::flat_hash_set seen_plans; + for (int64_t i = 1; i <= 3; ++i) { + SCOPED_TRACE(absl::Substitute("agent id = $0", i)); + auto agent_instance = physical_plan->Get(i); + if (i != 4) { + EXPECT_THAT(agent_instance->carnot_info().query_broker_address(), ContainsRegex("pem")); + } else { + EXPECT_THAT(agent_instance->carnot_info().query_broker_address(), ContainsRegex("kelvin")); + } + + if (seen_plans.contains(agent_instance->plan())) { + continue; + } + + seen_plans.insert(agent_instance->plan()); + std::vector grpc_sinks = + agent_instance->plan()->FindNodesOfType(IRNodeType::kGRPCSink); + ASSERT_EQ(grpc_sinks.size(), 1); + auto grpc_sink = static_cast(grpc_sinks[0]); + for (const auto& [agent_id, dest_id] : grpc_sink->agent_id_to_destination_id()) { + grpc_sink_destinations.push_back(dest_id); + } + } + + auto kelvin_instance = physical_plan->Get(0); + EXPECT_THAT(kelvin_instance->carnot_info().query_broker_address(), ContainsRegex("kelvin")); + + std::vector unions = kelvin_instance->plan()->FindNodesOfType(IRNodeType::kUnion); + ASSERT_EQ(unions.size(), 1); + UnionIR* kelvin_union = static_cast(unions[0]); + ASSERT_EQ(kelvin_union->parents().size(), 4); + + std::vector grpc_source_ids; + std::vector memory_source_ids; + for (OperatorIR* union_parent : kelvin_union->parents()) { + if (union_parent->type() == IRNodeType::kGRPCSource) { + auto grpc_source = static_cast(union_parent); + grpc_source_ids.push_back(grpc_source->id()); + } else { + ASSERT_EQ(union_parent->type(), IRNodeType::kMemorySource); + memory_source_ids.push_back(union_parent->id()); + } + } + ASSERT_EQ(grpc_source_ids.size(), 3); + ASSERT_EQ(memory_source_ids.size(), 1); + + // Make sure that the destinations are setup properly. + EXPECT_THAT(grpc_sink_destinations, UnorderedElementsAreArray(grpc_source_ids)); +} + using DistributedPlannerUDTFTests = DistributedRulesTest; TEST_F(DistributedPlannerUDTFTests, UDTFOnlyOnPEMsDoesntRunOnKelvin) { uint32_t asid = 123; diff --git a/src/carnot/planner/distributed/distributed_stitcher_rules_test.cc b/src/carnot/planner/distributed/distributed_stitcher_rules_test.cc index 49879679256..34962fb8c9b 100644 --- a/src/carnot/planner/distributed/distributed_stitcher_rules_test.cc +++ b/src/carnot/planner/distributed/distributed_stitcher_rules_test.cc @@ -298,6 +298,64 @@ TEST_F(StitcherTest, three_pems_one_kelvin) { } } +TEST_F(StitcherTest, three_pems_with_participating_kelvin) { + auto ps = LoadDistributedStatePb(testutils::kThreePEMsOneKelvinAllHasDataStoreDistributedState); + auto physical_plan = MakeDistributedPlan(ps); + auto topo_sort = physical_plan->dag().TopologicalSort(); + ASSERT_EQ(topo_sort.size(), 5); + ASSERT_EQ(topo_sort[4], 0); + + CarnotInstance* kelvin = physical_plan->Get(0); + std::string kelvin_qb_address = "kelvin"; + ASSERT_EQ(kelvin->carnot_info().query_broker_address(), kelvin_qb_address); + + std::vector data_sources; + for (int64_t agent_id = 1; agent_id <= 4; ++agent_id) { + CarnotInstance* agent = physical_plan->Get(agent_id); + // Quick check to make sure agents are valid. + ASSERT_THAT(agent->carnot_info().query_broker_address(), HasSubstr("pem")); + data_sources.push_back(agent); + } + // Kelvin can be a data source sometimes. + data_sources.push_back(kelvin); + { + SCOPED_TRACE("three_pems_with_participating_kelvin"); + TestBeforeSetSourceGroupGRPCAddress(data_sources, {kelvin}); + } + + // Execute the address rule. + DistributedSetSourceGroupGRPCAddressRule rule; + auto node_changed_or_s = rule.Execute(physical_plan.get()); + ASSERT_OK(node_changed_or_s); + ASSERT_TRUE(node_changed_or_s.ConsumeValueOrDie()); + + { + SCOPED_TRACE("three_pems_with_participating_kelvin"); + TestGRPCAddressSet({kelvin}); + } + + // Associate the edges of the graph. + AssociateDistributedPlanEdgesRule distributed_edges_rule; + node_changed_or_s = distributed_edges_rule.Execute(physical_plan.get()); + ASSERT_OK(node_changed_or_s); + ASSERT_TRUE(node_changed_or_s.ConsumeValueOrDie()); + + { + SCOPED_TRACE("three_pems_with_participating_kelvin"); + TestGRPCBridgesWiring(data_sources, {kelvin}); + } + + DistributedIRRule distributed_grpc_source_conv_rule; + node_changed_or_s = distributed_grpc_source_conv_rule.Execute(physical_plan.get()); + ASSERT_OK(node_changed_or_s); + ASSERT_TRUE(node_changed_or_s.ConsumeValueOrDie()); + + { + SCOPED_TRACE("three_pems_with_participating_kelvin"); + TestGRPCBridgesExpandedCorrectly(data_sources, {kelvin}); + } +} + // Test to see whether we can stitch a graph to itself. TEST_F(StitcherTest, stitch_self_together_with_udtf) { auto ps = LoadDistributedStatePb(kOnePEMOneKelvinDistributedState); @@ -339,7 +397,7 @@ TEST_F(StitcherTest, stitch_self_together_with_udtf) { } // Test to see whether we can stitch a graph to itself. -TEST_F(StitcherTest, stitch_all_togther_with_udtf) { +TEST_F(StitcherTest, stitch_all_together_with_udtf) { auto ps = LoadDistributedStatePb(kOnePEMOneKelvinDistributedState); // px._Test_MDState() is an all agent so it should run on every pem and kelvin. auto physical_plan = CoordinateQuery("import px\npx.display(px._Test_MD_State())", ps); @@ -381,6 +439,8 @@ TEST_F(StitcherTest, stitch_all_togther_with_udtf) { // connected. auto kelvin_plan = kelvin->plan(); auto pem_plan = pem->plan(); + LOG(INFO) << "Kelvin plan: " << kelvin_plan->DebugString(); + LOG(INFO) << "PEM plan: " << pem_plan->DebugString(); auto kelvin_grpc_sinks = kelvin_plan->FindNodesThatMatch(InternalGRPCSink()); ASSERT_EQ(kelvin_grpc_sinks.size(), 1); diff --git a/src/carnot/planner/distributed/splitter/splitter.h b/src/carnot/planner/distributed/splitter/splitter.h index 5ba2a997dc3..42227c1a705 100644 --- a/src/carnot/planner/distributed/splitter/splitter.h +++ b/src/carnot/planner/distributed/splitter/splitter.h @@ -54,7 +54,7 @@ struct BlockingSplitPlan { std::unique_ptr before_blocking; // The plan that occcurs after and including blocking nodes. std::unique_ptr after_blocking; - // The that has both the before and after blocking nodes. + // The plan that has both the before and after blocking nodes. std::unique_ptr original_plan; }; diff --git a/src/carnot/planner/file_source/BUILD.bazel b/src/carnot/planner/file_source/BUILD.bazel new file mode 100644 index 00000000000..2d00258245f --- /dev/null +++ b/src/carnot/planner/file_source/BUILD.bazel @@ -0,0 +1,52 @@ +# Copyright 2018- The Pixie Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +load("//bazel:pl_build_system.bzl", "pl_cc_binary", "pl_cc_library", "pl_cc_test") + +package(default_visibility = [ + "//src/carnot:__subpackages__", + "//src/experimental/standalone_pem:__subpackages__", # TODO(ddelnano): Is this needed? +]) + +pl_cc_library( + name = "cc_library", + srcs = glob( + [ + "*.cc", + "*.h", + ], + exclude = [ + "**/*_test.cc", + "**/*_test_utils.h", + ], + ), + hdrs = ["file_source.h"], + deps = [ + "//src/carnot/planner/objects:cc_library", + "//src/carnot/planner/probes:cc_library", + "//src/common/uuid:cc_library", # TODO(ddelnano): This may not be needed + ], +) + +pl_cc_test( + name = "file_source_test", + srcs = ["file_source_test.cc"], + deps = [ + ":cc_library", + "//src/carnot/planner:test_utils", + "//src/carnot/planner/compiler:cc_library", + ], +) diff --git a/src/carnot/planner/file_source/file_source.cc b/src/carnot/planner/file_source/file_source.cc new file mode 100644 index 00000000000..4e7c0e88a96 --- /dev/null +++ b/src/carnot/planner/file_source/file_source.cc @@ -0,0 +1,27 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "src/carnot/planner/file_source/file_source.h" + +namespace px { +namespace carnot { +namespace planner { +namespace compiler {} // namespace compiler +} // namespace planner +} // namespace carnot +} // namespace px diff --git a/src/carnot/planner/file_source/file_source.h b/src/carnot/planner/file_source/file_source.h new file mode 100644 index 00000000000..e15c1f734ac --- /dev/null +++ b/src/carnot/planner/file_source/file_source.h @@ -0,0 +1,37 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "src/carnot/planner/objects/funcobject.h" + +namespace px { +namespace carnot { +namespace planner { +namespace compiler { + +class FileSourceIR { + /* public: */ + + /* private: */ +}; + +} // namespace compiler +} // namespace planner +} // namespace carnot +} // namespace px diff --git a/src/carnot/planner/file_source/file_source_test.cc b/src/carnot/planner/file_source/file_source_test.cc new file mode 100644 index 00000000000..1105a3b26d6 --- /dev/null +++ b/src/carnot/planner/file_source/file_source_test.cc @@ -0,0 +1,91 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "src/carnot/planner/compiler/ast_visitor.h" +#include "src/carnot/planner/compiler/test_utils.h" +#include "src/carnot/planner/probes/probes.h" + +namespace px { +namespace carnot { +namespace planner { +namespace compiler { +using ::testing::ContainsRegex; +using ::testing::Not; +using ::testing::UnorderedElementsAre; + +constexpr char kSingleFileSource[] = R"pxl( +import pxlog + +glob_pattern = 'test.json' +pxlog.FileSource(glob_pattern, 'test_table', '5m') +)pxl"; + +constexpr char kSingleFileSourceProgramPb[] = R"pxl( +glob_pattern: "test.json" +table_name: "test_table" +ttl { + seconds: 300 +} +)pxl"; + +class FileSourceCompilerTest : public ASTVisitorTest { + protected: + StatusOr> CompileFileSourceScript( + std::string_view query, const ExecFuncs& exec_funcs = {}) { + absl::flat_hash_set reserved_names; + for (const auto& func : exec_funcs) { + reserved_names.insert(func.output_table_prefix()); + } + auto func_based_exec = exec_funcs.size() > 0; + + Parser parser; + PX_ASSIGN_OR_RETURN(auto ast, parser.Parse(query)); + + std::shared_ptr ir = std::make_shared(); + std::shared_ptr mutation_ir = std::make_shared(); + + ModuleHandler module_handler; + PX_ASSIGN_OR_RETURN(auto ast_walker, compiler::ASTVisitorImpl::Create( + ir.get(), mutation_ir.get(), compiler_state_.get(), + &module_handler, func_based_exec, reserved_names, {})); + + PX_RETURN_IF_ERROR(ast_walker->ProcessModuleNode(ast)); + if (func_based_exec) { + PX_RETURN_IF_ERROR(ast_walker->ProcessExecFuncs(exec_funcs)); + } + return mutation_ir; + } +}; + +// TODO(ddelnano): Add test that verifies missing arguments provides a compiler error +// instead of the "Query should not be empty" error. There seems to be a bug where default +// arguments are not being handled correctly. + +TEST_F(FileSourceCompilerTest, parse_single_file_source) { + ASSERT_OK_AND_ASSIGN(auto mutation_ir, CompileFileSourceScript(kSingleFileSource)); + plannerpb::CompileMutationsResponse pb; + EXPECT_OK(mutation_ir->ToProto(&pb)); + ASSERT_EQ(pb.mutations_size(), 1); + EXPECT_THAT(pb.mutations()[0].file_source(), + testing::proto::EqualsProto(kSingleFileSourceProgramPb)); +} + +} // namespace compiler +} // namespace planner +} // namespace carnot +} // namespace px diff --git a/src/carnot/planner/file_source/ir/BUILD.bazel b/src/carnot/planner/file_source/ir/BUILD.bazel new file mode 100644 index 00000000000..759282f6c38 --- /dev/null +++ b/src/carnot/planner/file_source/ir/BUILD.bazel @@ -0,0 +1,41 @@ +# Copyright 2018- The Pixie Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +load("//bazel:proto_compile.bzl", "pl_cc_proto_library", "pl_go_proto_library", "pl_proto_library") + +package(default_visibility = ["//src:__subpackages__"]) + +pl_proto_library( + name = "logical_pl_proto", + srcs = ["logical.proto"], + deps = [ + "@gogo_grpc_proto//gogoproto:gogo_pl_proto", + ], +) + +pl_cc_proto_library( + name = "logical_pl_cc_proto", + proto = ":logical_pl_proto", + deps = [ + "@gogo_grpc_proto//gogoproto:gogo_pl_cc_proto", + ], +) + +pl_go_proto_library( + name = "logical_pl_go_proto", + importpath = "px.dev/pixie/src/carnot/planner/file_source/ir", + proto = ":logical_pl_proto", +) diff --git a/src/carnot/planner/file_source/ir/logical.pb.go b/src/carnot/planner/file_source/ir/logical.pb.go new file mode 100755 index 00000000000..f424f8ec525 --- /dev/null +++ b/src/carnot/planner/file_source/ir/logical.pb.go @@ -0,0 +1,567 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: src/carnot/planner/file_source/ir/logical.proto + +package ir + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type FileSourceDeployment struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + GlobPattern string `protobuf:"bytes,2,opt,name=glob_pattern,json=globPattern,proto3" json:"glob_pattern,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + TTL *types.Duration `protobuf:"bytes,4,opt,name=ttl,proto3" json:"ttl,omitempty"` +} + +func (m *FileSourceDeployment) Reset() { *m = FileSourceDeployment{} } +func (*FileSourceDeployment) ProtoMessage() {} +func (*FileSourceDeployment) Descriptor() ([]byte, []int) { + return fileDescriptor_452b4826b1190f86, []int{0} +} +func (m *FileSourceDeployment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileSourceDeployment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FileSourceDeployment.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FileSourceDeployment) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileSourceDeployment.Merge(m, src) +} +func (m *FileSourceDeployment) XXX_Size() int { + return m.Size() +} +func (m *FileSourceDeployment) XXX_DiscardUnknown() { + xxx_messageInfo_FileSourceDeployment.DiscardUnknown(m) +} + +var xxx_messageInfo_FileSourceDeployment proto.InternalMessageInfo + +func (m *FileSourceDeployment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FileSourceDeployment) GetGlobPattern() string { + if m != nil { + return m.GlobPattern + } + return "" +} + +func (m *FileSourceDeployment) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *FileSourceDeployment) GetTTL() *types.Duration { + if m != nil { + return m.TTL + } + return nil +} + +func init() { + proto.RegisterType((*FileSourceDeployment)(nil), "px.carnot.planner.file_source.ir.FileSourceDeployment") +} + +func init() { + proto.RegisterFile("src/carnot/planner/file_source/ir/logical.proto", fileDescriptor_452b4826b1190f86) +} + +var fileDescriptor_452b4826b1190f86 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8e, 0xb1, 0x4e, 0x42, 0x31, + 0x18, 0x85, 0x6f, 0x81, 0x68, 0x28, 0x4e, 0x37, 0x0c, 0x48, 0xe2, 0x2f, 0x3a, 0x31, 0xb5, 0x89, + 0x3a, 0x38, 0x13, 0xe2, 0x64, 0x8c, 0x41, 0x26, 0x17, 0xd2, 0x7b, 0x2d, 0x4d, 0x93, 0xd2, 0xff, + 0x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fb, 0x71, 0xa3, 0xc3, 0xf0, 0x75, 0xda, 0x9c, 0x4e, 0x6f, + 0x27, 0x15, 0x3e, 0xba, 0x5e, 0x6f, 0x21, 0xd9, 0x6c, 0x21, 0xd9, 0x6d, 0x81, 0xbc, 0x06, 0x20, + 0x1f, 0x01, 0xc8, 0x67, 0x00, 0xb2, 0x0e, 0x40, 0xbe, 0x03, 0x90, 0x9f, 0x00, 0xc9, 0x2e, 0x00, + 0x79, 0x2b, 0x21, 0x59, 0x97, 0x90, 0x6c, 0x4a, 0x48, 0x1e, 0x1b, 0xda, 0x65, 0x07, 0xb1, 0xfa, + 0xf2, 0x37, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x07, 0x40, 0x1c, 0x70, 0x01, 0x00, 0x00, +} + +func (this *FileSourceDeployment) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FileSourceDeployment) + if !ok { + that2, ok := that.(FileSourceDeployment) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.GlobPattern != that1.GlobPattern { + return false + } + if this.TableName != that1.TableName { + return false + } + if !this.TTL.Equal(that1.TTL) { + return false + } + return true +} +func (this *FileSourceDeployment) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&ir.FileSourceDeployment{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "GlobPattern: "+fmt.Sprintf("%#v", this.GlobPattern)+",\n") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + if this.TTL != nil { + s = append(s, "TTL: "+fmt.Sprintf("%#v", this.TTL)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringLogical(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *FileSourceDeployment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileSourceDeployment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceDeployment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TTL != nil { + { + size, err := m.TTL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogical(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintLogical(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0x1a + } + if len(m.GlobPattern) > 0 { + i -= len(m.GlobPattern) + copy(dAtA[i:], m.GlobPattern) + i = encodeVarintLogical(dAtA, i, uint64(len(m.GlobPattern))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintLogical(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintLogical(dAtA []byte, offset int, v uint64) int { + offset -= sovLogical(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *FileSourceDeployment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovLogical(uint64(l)) + } + l = len(m.GlobPattern) + if l > 0 { + n += 1 + l + sovLogical(uint64(l)) + } + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovLogical(uint64(l)) + } + if m.TTL != nil { + l = m.TTL.Size() + n += 1 + l + sovLogical(uint64(l)) + } + return n +} + +func sovLogical(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLogical(x uint64) (n int) { + return sovLogical(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *FileSourceDeployment) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceDeployment{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `GlobPattern:` + fmt.Sprintf("%v", this.GlobPattern) + `,`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `TTL:` + strings.Replace(fmt.Sprintf("%v", this.TTL), "Duration", "types.Duration", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringLogical(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *FileSourceDeployment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogical + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileSourceDeployment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileSourceDeployment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogical + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogical + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogical + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobPattern", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogical + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogical + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogical + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GlobPattern = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogical + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogical + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogical + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogical + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogical + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogical + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TTL == nil { + m.TTL = &types.Duration{} + } + if err := m.TTL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogical(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogical + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLogical(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLogical + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLogical + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowLogical + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthLogical + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLogical + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLogical + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLogical = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLogical = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLogical = fmt.Errorf("proto: unexpected end of group") +) diff --git a/src/carnot/planner/file_source/ir/logical.proto b/src/carnot/planner/file_source/ir/logical.proto new file mode 100644 index 00000000000..7b64203c214 --- /dev/null +++ b/src/carnot/planner/file_source/ir/logical.proto @@ -0,0 +1,39 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +syntax = "proto3"; + +package px.carnot.planner.file_source.ir; + +option go_package = "ir"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +// A logical file source deployment +message FileSourceDeployment { + // For now this is the same as glob_pattern, but in the future may provide a logical name for the + // file source. + string name = 1; + // The glob pattern to use to find files to read. + string glob_pattern = 2; + // The table name to write the data to. + string table_name = 3; + // The ttl to run the file source for. -1 indicates that the file source should run indefinitely. + google.protobuf.Duration ttl = 4 [ (gogoproto.customname) = "TTL" ]; +} diff --git a/src/carnot/planner/file_source/log_module.cc b/src/carnot/planner/file_source/log_module.cc new file mode 100644 index 00000000000..6df5e582311 --- /dev/null +++ b/src/carnot/planner/file_source/log_module.cc @@ -0,0 +1,104 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "src/carnot/planner/file_source/log_module.h" + +namespace px { +namespace carnot { +namespace planner { +namespace compiler { + +class FileSourceHandler { + public: + static StatusOr Eval(MutationsIR* mutations_ir, const pypa::AstPtr& ast, + const ParsedArgs& args, ASTVisitor* visitor); +}; + +class DeleteFileSourceHandler { + public: + static StatusOr Eval(MutationsIR* mutations_ir, const pypa::AstPtr& ast, + const ParsedArgs& args, ASTVisitor* visitor); +}; + +StatusOr> LogModule::Create(MutationsIR* mutations_ir, + ASTVisitor* ast_visitor) { + auto tracing_module = std::shared_ptr(new LogModule(mutations_ir, ast_visitor)); + PX_RETURN_IF_ERROR(tracing_module->Init()); + return tracing_module; +} + +Status LogModule::Init() { + PX_ASSIGN_OR_RETURN( + std::shared_ptr upsert_fn, + FuncObject::Create(kFileSourceID, {"glob_pattern", "table_name", "ttl"}, {}, + /* has_variable_len_args */ false, + /* has_variable_len_kwargs */ false, + std::bind(FileSourceHandler::Eval, mutations_ir_, std::placeholders::_1, + std::placeholders::_2, std::placeholders::_3), + ast_visitor())); + PX_RETURN_IF_ERROR(upsert_fn->SetDocString(kFileSourceDocstring)); + AddMethod(kFileSourceID, upsert_fn); + + PX_ASSIGN_OR_RETURN(std::shared_ptr delete_fn, + FuncObject::Create(kFileSourceID, {"name"}, {}, + /* has_variable_len_args */ false, + /* has_variable_len_kwargs */ false, + std::bind(DeleteFileSourceHandler::Eval, mutations_ir_, + std::placeholders::_1, std::placeholders::_2, + std::placeholders::_3), + ast_visitor())); + PX_RETURN_IF_ERROR(upsert_fn->SetDocString(kDeleteFileSourceDocstring)); + AddMethod(kDeleteFileSourceID, delete_fn); + + return Status::OK(); +} + +StatusOr FileSourceHandler::Eval(MutationsIR* mutations_ir, const pypa::AstPtr& ast, + const ParsedArgs& args, ASTVisitor* visitor) { + DCHECK(mutations_ir); + + PX_ASSIGN_OR_RETURN(auto glob_pattern_ir, GetArgAs(ast, args, "glob_pattern")); + PX_ASSIGN_OR_RETURN(auto table_name_ir, GetArgAs(ast, args, "table_name")); + PX_ASSIGN_OR_RETURN(auto ttl_ir, GetArgAs(ast, args, "ttl")); + + const std::string& glob_pattern_str = glob_pattern_ir->str(); + const std::string& table_name_str = table_name_ir->str(); + PX_ASSIGN_OR_RETURN(int64_t ttl_ns, StringToTimeInt(ttl_ir->str())); + + mutations_ir->CreateFileSourceDeployment(glob_pattern_str, table_name_str, ttl_ns); + + return std::static_pointer_cast(std::make_shared(ast, visitor)); +} + +StatusOr DeleteFileSourceHandler::Eval(MutationsIR* mutations_ir, + const pypa::AstPtr& ast, const ParsedArgs& args, + ASTVisitor* visitor) { + DCHECK(mutations_ir); + + PX_ASSIGN_OR_RETURN(auto glob_pattern_ir, GetArgAs(ast, args, "name")); + const std::string& glob_pattern_str = glob_pattern_ir->str(); + + mutations_ir->DeleteFileSource(glob_pattern_str); + + return std::static_pointer_cast(std::make_shared(ast, visitor)); +} + +} // namespace compiler +} // namespace planner +} // namespace carnot +} // namespace px diff --git a/src/carnot/planner/file_source/log_module.h b/src/carnot/planner/file_source/log_module.h new file mode 100644 index 00000000000..5d5520dafa5 --- /dev/null +++ b/src/carnot/planner/file_source/log_module.h @@ -0,0 +1,69 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once +#include +#include +#include +#include + +#include "src/carnot/planner/compiler_state/compiler_state.h" +#include "src/carnot/planner/objects/funcobject.h" +#include "src/carnot/planner/objects/none_object.h" +#include "src/carnot/planner/probes/probes.h" + +namespace px { +namespace carnot { +namespace planner { +namespace compiler { + +class LogModule : public QLObject { + public: + static constexpr TypeDescriptor LogModuleType = { + /* name */ "pxlog", + /* type */ QLObjectType::kLogModule, + }; + static StatusOr> Create(MutationsIR* mutations_ir, + ASTVisitor* ast_visitor); + + // Constant for the modules. + inline static constexpr char kLogModuleObjName[] = "pxlog"; + + inline static constexpr char kFileSourceID[] = "FileSource"; + inline static constexpr char kFileSourceDocstring[] = R"doc( + TBD + )doc"; + + inline static constexpr char kDeleteFileSourceID[] = "DeleteFileSource"; + inline static constexpr char kDeleteFileSourceDocstring[] = R"doc( + TBD + )doc"; + + protected: + explicit LogModule(MutationsIR* mutations_ir, ASTVisitor* ast_visitor) + : QLObject(LogModuleType, ast_visitor), mutations_ir_(mutations_ir) {} + Status Init(); + + private: + MutationsIR* mutations_ir_; +}; + +} // namespace compiler +} // namespace planner +} // namespace carnot +} // namespace px diff --git a/src/carnot/planner/ir/grpc_sink_ir.cc b/src/carnot/planner/ir/grpc_sink_ir.cc index b087d3eaefc..786da032781 100644 --- a/src/carnot/planner/ir/grpc_sink_ir.cc +++ b/src/carnot/planner/ir/grpc_sink_ir.cc @@ -24,6 +24,7 @@ namespace planner { Status GRPCSinkIR::CopyFromNodeImpl(const IRNode* node, absl::flat_hash_map*) { + PX_RETURN_IF_ERROR(SinkOperatorIR::CopyFromNodeImpl(node, nullptr)); const GRPCSinkIR* grpc_sink = static_cast(node); sink_type_ = grpc_sink->sink_type_; destination_id_ = grpc_sink->destination_id_; @@ -35,6 +36,7 @@ Status GRPCSinkIR::CopyFromNodeImpl(const IRNode* node, } Status GRPCSinkIR::ToProto(planpb::Operator* op) const { + PX_RETURN_IF_ERROR(SinkOperatorIR::ToProto(op)); CHECK(has_output_table()); auto pb = op->mutable_grpc_sink_op(); op->set_op_type(planpb::GRPC_SINK_OPERATOR); @@ -54,6 +56,7 @@ Status GRPCSinkIR::ToProto(planpb::Operator* op) const { } Status GRPCSinkIR::ToProto(planpb::Operator* op, int64_t agent_id) const { + PX_RETURN_IF_ERROR(SinkOperatorIR::ToProto(op)); auto pb = op->mutable_grpc_sink_op(); op->set_op_type(planpb::GRPC_SINK_OPERATOR); pb->set_address(destination_address()); diff --git a/src/carnot/planner/ir/grpc_sink_ir.h b/src/carnot/planner/ir/grpc_sink_ir.h index b8ef691a6f6..9dea6307de3 100644 --- a/src/carnot/planner/ir/grpc_sink_ir.h +++ b/src/carnot/planner/ir/grpc_sink_ir.h @@ -43,9 +43,10 @@ namespace planner { * 1. SetDistributedID(string): Set the name of the node same as the query broker. * 2. SetDestinationAddress(string): the GRPC address where batches should be sent. */ -class GRPCSinkIR : public OperatorIR { +class GRPCSinkIR : public SinkOperatorIR { public: - explicit GRPCSinkIR(int64_t id) : OperatorIR(id, IRNodeType::kGRPCSink) {} + explicit GRPCSinkIR(int64_t id, std::string mutation_id) + : SinkOperatorIR(id, IRNodeType::kGRPCSink, mutation_id) {} enum GRPCSinkType { kTypeNotSet = 0, @@ -110,6 +111,17 @@ class GRPCSinkIR : public OperatorIR { destination_ssl_targetname_ = ssl_targetname; } + std::string DebugString() const override { + auto sink_op_str = SinkOperatorIR::DebugString(); + std::vector agent_ids; + for (const auto& [agent_id, _] : agent_id_to_destination_id_) { + agent_ids.push_back(agent_id); + } + return absl::Substitute("$0(id=$1, destination_id=$2, destination_address=$3, sink_type=$4, agent_ids=$5 sink_op=$6)", + type_string(), id(), destination_id_, destination_address_, + sink_type_, absl::StrJoin(agent_ids, ","), sink_op_str); + } + const std::string& destination_address() const { return destination_address_; } bool DestinationAddressSet() const { return destination_address_ != ""; } const std::string& destination_ssl_targetname() const { return destination_ssl_targetname_; } diff --git a/src/carnot/planner/ir/ir.h b/src/carnot/planner/ir/ir.h index faeb0623eea..df5c88aecae 100644 --- a/src/carnot/planner/ir/ir.h +++ b/src/carnot/planner/ir/ir.h @@ -49,6 +49,7 @@ namespace planner { class ExpressionIR; class OperatorIR; +class SinkOperatorIR; /** * IR contains the intermediate representation of the query @@ -77,7 +78,13 @@ class IR { template StatusOr MakeNode(int64_t id, const pypa::AstPtr& ast) { id_node_counter = std::max(id + 1, id_node_counter); - auto node = std::make_unique(id); + std::unique_ptr node; + if constexpr (std::is_base_of_v) { + auto mutation_id = mutation_id_.value_or(""); + node = std::make_unique(id, mutation_id); + } else { + node = std::make_unique(id); + } dag_.AddNode(node->id()); node->set_graph(this); if (ast != nullptr) { @@ -123,6 +130,9 @@ class IR { } // Use the source's ID if we are copying in to a different graph. auto new_node_id = this == source->graph() ? id_node_counter : source->id(); + if (this != source->graph()) { + mutation_id_ = source->graph()->mutation_id(); + } DCHECK(!HasNode(new_node_id)) << source->DebugString(); PX_ASSIGN_OR_RETURN(IRNode * new_node, MakeNodeWithType(source->type(), new_node_id)); PX_RETURN_IF_ERROR(new_node->CopyFromNode(source, copied_nodes_map)); @@ -258,6 +268,13 @@ class IR { return nodes; } + void RecordMutationId(std::optional mutation_id) { + DCHECK(!mutation_id_.has_value()) << "Mutation ID should only be set once."; + mutation_id_ = mutation_id; + } + + std::optional mutation_id() const { return mutation_id_; } + friend std::ostream& operator<<(std::ostream& os, const std::shared_ptr&) { return os << "ir"; } @@ -270,6 +287,7 @@ class IR { plan::DAG dag_; std::unordered_map id_node_map_; int64_t id_node_counter = 0; + std::optional mutation_id_ = std::nullopt; }; Status ResolveOperatorType(OperatorIR* op, CompilerState* compiler_state); diff --git a/src/carnot/planner/ir/memory_sink_ir.cc b/src/carnot/planner/ir/memory_sink_ir.cc index 943e165f47a..7e8fffee763 100644 --- a/src/carnot/planner/ir/memory_sink_ir.cc +++ b/src/carnot/planner/ir/memory_sink_ir.cc @@ -31,6 +31,7 @@ Status MemorySinkIR::Init(OperatorIR* parent, const std::string& name, } Status MemorySinkIR::ToProto(planpb::Operator* op) const { + PX_RETURN_IF_ERROR(SinkOperatorIR::ToProto(op)); auto pb = op->mutable_mem_sink_op(); pb->set_name(name_); op->set_op_type(planpb::MEMORY_SINK_OPERATOR); @@ -47,6 +48,7 @@ Status MemorySinkIR::ToProto(planpb::Operator* op) const { Status MemorySinkIR::CopyFromNodeImpl(const IRNode* node, absl::flat_hash_map*) { + PX_RETURN_IF_ERROR(SinkOperatorIR::CopyFromNodeImpl(node, nullptr)); const MemorySinkIR* sink_ir = static_cast(node); name_ = sink_ir->name_; out_columns_ = sink_ir->out_columns_; diff --git a/src/carnot/planner/ir/memory_sink_ir.h b/src/carnot/planner/ir/memory_sink_ir.h index c43b36698f3..eb50373a41f 100644 --- a/src/carnot/planner/ir/memory_sink_ir.h +++ b/src/carnot/planner/ir/memory_sink_ir.h @@ -38,10 +38,11 @@ namespace planner { /** * The MemorySinkIR describes the MemorySink operator. */ -class MemorySinkIR : public OperatorIR { +class MemorySinkIR : public SinkOperatorIR { public: MemorySinkIR() = delete; - explicit MemorySinkIR(int64_t id) : OperatorIR(id, IRNodeType::kMemorySink) {} + explicit MemorySinkIR(int64_t id, std::string mutation_id) + : SinkOperatorIR(id, IRNodeType::kMemorySink, mutation_id) {} std::string name() const { return name_; } void set_name(const std::string& name) { name_ = name; } diff --git a/src/carnot/planner/ir/memory_source_ir.cc b/src/carnot/planner/ir/memory_source_ir.cc index fc367ce7fc0..18e92dc2107 100644 --- a/src/carnot/planner/ir/memory_source_ir.cc +++ b/src/carnot/planner/ir/memory_source_ir.cc @@ -29,6 +29,7 @@ std::string MemorySourceIR::DebugString() const { } Status MemorySourceIR::ToProto(planpb::Operator* op) const { + PX_RETURN_IF_ERROR(SinkOperatorIR::ToProto(op)); auto pb = op->mutable_mem_source_op(); op->set_op_type(planpb::MEMORY_SOURCE_OPERATOR); pb->set_name(table_name_); diff --git a/src/carnot/planner/ir/memory_source_ir.h b/src/carnot/planner/ir/memory_source_ir.h index 757632d2096..2339ab4b27f 100644 --- a/src/carnot/planner/ir/memory_source_ir.h +++ b/src/carnot/planner/ir/memory_source_ir.h @@ -40,10 +40,10 @@ namespace planner { * @brief The MemorySourceIR is a dual logical plan * and IR node operator. It inherits from both classes */ -class MemorySourceIR : public OperatorIR { +class MemorySourceIR : public SinkOperatorIR { public: MemorySourceIR() = delete; - explicit MemorySourceIR(int64_t id) : OperatorIR(id, IRNodeType::kMemorySource) {} + explicit MemorySourceIR(int64_t id, std::string mutation_id) : SinkOperatorIR(id, IRNodeType::kMemorySource, mutation_id) {} /** * @brief Initialize the memory source. diff --git a/src/carnot/planner/ir/operator_ir.h b/src/carnot/planner/ir/operator_ir.h index a719432efec..c899679f8bb 100644 --- a/src/carnot/planner/ir/operator_ir.h +++ b/src/carnot/planner/ir/operator_ir.h @@ -181,6 +181,40 @@ class OperatorIR : public IRNode { std::vector parent_types_; bool parent_types_set_ = false; }; + +class SinkOperatorIR : public OperatorIR { + public: + std::string DebugString() const { + return absl::Substitute("$0(id=$1, mutation_id=$2)", type_string(), id(), mutation_id_); + } + + protected: + explicit SinkOperatorIR(int64_t id, IRNodeType type, std::string mutation_id) + : OperatorIR(id, type), mutation_id_(mutation_id) {} + + virtual Status ToProto(planpb::Operator* op) const { + if (mutation_id_.empty()) { + return Status::OK(); + } + auto context = op->mutable_context(); + context->insert({"mutation_id", mutation_id_}); + return Status::OK(); + } + + /** + * @brief Override of CopyFromNode that adds special handling for Operators. + */ + virtual Status CopyFromNodeImpl(const IRNode* node, + absl::flat_hash_map*) { + const SinkOperatorIR* source = static_cast(node); + mutation_id_ = source->mutation_id_; + return Status::OK(); + } + + private: + std::string mutation_id_; +}; + } // namespace planner } // namespace carnot } // namespace px diff --git a/src/carnot/planner/ir/otel_export_sink_ir.cc b/src/carnot/planner/ir/otel_export_sink_ir.cc index 672ca2c5767..defa26e3ee3 100644 --- a/src/carnot/planner/ir/otel_export_sink_ir.cc +++ b/src/carnot/planner/ir/otel_export_sink_ir.cc @@ -18,6 +18,8 @@ #include +#include + #include "src/carnot/planner/ir/ir.h" #include "src/carnot/planner/ir/otel_export_sink_ir.h" #include "src/carnot/planpb/plan.pb.h" @@ -160,10 +162,34 @@ Status OTelExportSinkIR::ProcessConfig(const OTelData& data) { new_span.span_kind = span.span_kind; data_.spans.push_back(std::move(new_span)); } + for (const auto& log : data.logs) { + OTelLog new_log; + + PX_ASSIGN_OR_RETURN(new_log.time_column, AddColumn(log.time_column)); + PX_ASSIGN_OR_RETURN(new_log.body_column, AddColumn(log.body_column)); + if (log.observed_time_column != nullptr) { + PX_ASSIGN_OR_RETURN(new_log.observed_time_column, AddColumn(log.observed_time_column)); + } + + new_log.severity_text = log.severity_text; + new_log.severity_number = log.severity_number; + + for (const auto& attr : log.attributes) { + if (attr.column_reference == nullptr) { + new_log.attributes.push_back({attr.name, nullptr, attr.string_value}); + continue; + } + PX_ASSIGN_OR_RETURN(auto column, AddColumn(attr.column_reference)); + new_log.attributes.push_back({attr.name, column, ""}); + } + + data_.logs.push_back(std::move(new_log)); + } return Status::OK(); } Status OTelExportSinkIR::ToProto(planpb::Operator* op) const { + PX_RETURN_IF_ERROR(SinkOperatorIR::ToProto(op)); op->set_op_type(planpb::OTEL_EXPORT_SINK_OPERATOR); auto otel_op = op->mutable_otel_sink_op(); *otel_op->mutable_endpoint_config() = data_.endpoint_config; @@ -330,11 +356,56 @@ Status OTelExportSinkIR::ToProto(planpb::Operator* op) const { } span_pb->set_kind_value(span.span_kind); } + for (const auto& log : data_.logs) { + auto log_pb = otel_op->add_logs(); + + if (log.time_column->EvaluatedDataType() != types::TIME64NS) { + return log.time_column->CreateIRNodeError( + "Expected time column '$0' to be TIME64NS, received $1", log.time_column->col_name(), + types::ToString(log.time_column->EvaluatedDataType())); + } + PX_ASSIGN_OR_RETURN(auto time_column_index, + log.time_column->GetColumnIndex()); + log_pb->set_time_column_index(time_column_index); + + if (log.observed_time_column != nullptr) { + if (log.observed_time_column->EvaluatedDataType() != types::TIME64NS) { + return log.observed_time_column->CreateIRNodeError( + "Expected observed_time column '$0' to be TIME64NS, received $1", log.observed_time_column->col_name(), + types::ToString(log.observed_time_column->EvaluatedDataType())); + } + PX_ASSIGN_OR_RETURN(auto observed_time_column_index, + log.observed_time_column->GetColumnIndex()); + log_pb->set_observed_time_column_index(observed_time_column_index); + } else { + log_pb->set_observed_time_column_index(-1); + } + + log_pb->set_severity_text(log.severity_text); + + // TODO(ddelnano): Add validation for severity_number if the planner isn't the right + // place to implement the validation. + log_pb->set_severity_number(log.severity_number); + + if (log.body_column->EvaluatedDataType() != types::STRING) { + return log.body_column->CreateIRNodeError( + "Expected body column '$0' to be STRING, received $1", log.body_column->col_name(), + types::ToString(log.body_column->EvaluatedDataType())); + } + PX_ASSIGN_OR_RETURN(auto body_column_index, + log.body_column->GetColumnIndex()); + log_pb->set_body_column_index(body_column_index); + + for (const auto& attribute : log.attributes) { + PX_RETURN_IF_ERROR(attribute.ToProto(log_pb->add_attributes())); + } + } return Status::OK(); } Status OTelExportSinkIR::CopyFromNodeImpl(const IRNode* node, absl::flat_hash_map*) { + PX_RETURN_IF_ERROR(SinkOperatorIR::CopyFromNodeImpl(node, nullptr)); const OTelExportSinkIR* source = static_cast(node); return ProcessConfig(source->data_); } diff --git a/src/carnot/planner/ir/otel_export_sink_ir.h b/src/carnot/planner/ir/otel_export_sink_ir.h index 2caad972498..cced5ada202 100644 --- a/src/carnot/planner/ir/otel_export_sink_ir.h +++ b/src/carnot/planner/ir/otel_export_sink_ir.h @@ -127,11 +127,23 @@ struct OTelSpan { int64_t span_kind; }; +struct OTelLog { + std::vector attributes; + + ColumnIR* time_column; + ColumnIR* observed_time_column = nullptr; + ColumnIR* body_column; + + int64_t severity_number; + std::string severity_text; +}; + struct OTelData { planpb::OTelEndpointConfig endpoint_config; std::vector resource_attributes; std::vector metrics; std::vector spans; + std::vector logs; }; /** @@ -139,9 +151,10 @@ struct OTelData { * Represents a configuration to transform a DataFrame into OpenTelemetry * data. */ -class OTelExportSinkIR : public OperatorIR { +class OTelExportSinkIR : public SinkOperatorIR { public: - explicit OTelExportSinkIR(int64_t id) : OperatorIR(id, IRNodeType::kOTelExportSink) {} + explicit OTelExportSinkIR(int64_t id, std::string mutation_id) + : SinkOperatorIR(id, IRNodeType::kOTelExportSink, mutation_id) {} Status Init(OperatorIR* parent, const OTelData& data) { PX_RETURN_IF_ERROR(ProcessConfig(data)); diff --git a/src/carnot/planner/ir/otel_export_sink_ir_test.cc b/src/carnot/planner/ir/otel_export_sink_ir_test.cc index b508b2d8afb..e70abb21637 100644 --- a/src/carnot/planner/ir/otel_export_sink_ir_test.cc +++ b/src/carnot/planner/ir/otel_export_sink_ir_test.cc @@ -443,6 +443,85 @@ INSTANTIATE_TEST_SUITE_P( .ConsumeValueOrDie(); }, }, + { + "logs_basic", + table_store::schema::Relation{ + {types::TIME64NS, types::STRING, types::STRING}, + {"start_time", "attribute_str", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE}}, + R"pb( + endpoint_config {} + resource {} + logs { + attributes { + name: "service.name" + column { + column_type: STRING + column_index: 1 + } + } + time_column_index: 0 + observed_time_column_index: -1 + severity_number: 4 + severity_text: "INFO" + body_column_index: 2 + } + )pb", + [](IR* graph, OperatorIR* parent, table_store::schema::Relation* relation) { + OTelData data; + + auto& log = data.logs.emplace_back(); + log.time_column = CreateTypedColumn(graph, "start_time", relation); + log.attributes.push_back( + {"service.name", CreateTypedColumn(graph, "attribute_str", relation), ""}); + log.severity_number = 4; + log.severity_text = "INFO"; + log.body_column = CreateTypedColumn(graph, "log_message", relation); + + return graph->CreateNode(parent->ast(), parent, data) + .ConsumeValueOrDie(); + }, + }, + { + "logs_with_observed_time_col", + table_store::schema::Relation{ + {types::TIME64NS, types::TIME64NS, types::STRING, types::STRING}, + {"start_time", "observed_time", "attribute_str", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE, types::ST_NONE}}, + R"pb( + endpoint_config {} + resource {} + logs { + attributes { + name: "service.name" + column { + column_type: STRING + column_index: 2 + } + } + time_column_index: 0 + observed_time_column_index: 1 + severity_number: 4 + severity_text: "INFO" + body_column_index: 3 + } + )pb", + [](IR* graph, OperatorIR* parent, table_store::schema::Relation* relation) { + OTelData data; + + auto& log = data.logs.emplace_back(); + log.time_column = CreateTypedColumn(graph, "start_time", relation); + log.observed_time_column = CreateTypedColumn(graph, "observed_time", relation); + log.attributes.push_back( + {"service.name", CreateTypedColumn(graph, "attribute_str", relation), ""}); + log.severity_number = 4; + log.severity_text = "INFO"; + log.body_column = CreateTypedColumn(graph, "log_message", relation); + + return graph->CreateNode(parent->ast(), parent, data) + .ConsumeValueOrDie(); + }, + }, { "string_value_attributes", table_store::schema::Relation{{types::TIME64NS, types::INT64}, @@ -557,6 +636,33 @@ OTelExportSinkIR* CreateSpanWithNameString(IR* graph, OperatorIR* parent, return graph->CreateNode(parent->ast(), parent, data).ConsumeValueOrDie(); } +OTelExportSinkIR* CreateLog(IR* graph, OperatorIR* parent, + table_store::schema::Relation* relation) { + OTelData data; + + auto& log = data.logs.emplace_back(); + log.time_column = CreateTypedColumn(graph, "start_time", relation); + log.body_column = CreateTypedColumn(graph, "log_message", relation); + log.severity_number = 4; + log.severity_text = "INFO"; + + return graph->CreateNode(parent->ast(), parent, data).ConsumeValueOrDie(); +} + +OTelExportSinkIR* CreateLogWithObservedTime(IR* graph, OperatorIR* parent, + table_store::schema::Relation* relation) { + OTelData data; + + auto& log = data.logs.emplace_back(); + log.time_column = CreateTypedColumn(graph, "start_time", relation); + log.observed_time_column = CreateTypedColumn(graph, "observed_time", relation); + log.body_column = CreateTypedColumn(graph, "log_message", relation); + log.severity_number = 4; + log.severity_text = "INFO"; + + return graph->CreateNode(parent->ast(), parent, data).ConsumeValueOrDie(); +} + INSTANTIATE_TEST_SUITE_P( ErrorTests, WrongColumnTypesTest, ::testing::ValuesIn(std::vector{ @@ -723,6 +829,33 @@ INSTANTIATE_TEST_SUITE_P( .ConsumeValueOrDie(); }, }, + { + "log_time_column_wrong", + table_store::schema::Relation{ + {types::INT64, types::STRING, types::STRING}, + {"start_time", "attribute_str", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE}}, + "Expected time column 'start_time' to be TIME64NS, received INT64", + &CreateLog, + }, + { + "log_body_column_wrong", + table_store::schema::Relation{ + {types::TIME64NS, types::STRING, types::TIME64NS}, + {"start_time", "attribute_str", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE}}, + "Expected body column 'log_message' to be STRING, received TIME64NS", + &CreateLog, + }, + { + "log_observed_time_column_wrong", + table_store::schema::Relation{ + {types::TIME64NS, types::INT64, types::STRING, types::STRING}, + {"start_time", "observed_time", "attribute_str", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE, types::ST_NONE}}, + "Expected observed_time column 'observed_time' to be TIME64NS, received INT64", + &CreateLogWithObservedTime, + }, }), [](const ::testing::TestParamInfo& info) { return info.param.name; }); } // namespace planner diff --git a/src/carnot/planner/logical_planner_test.cc b/src/carnot/planner/logical_planner_test.cc index 4c3e8659c88..2acd981cbc9 100644 --- a/src/carnot/planner/logical_planner_test.cc +++ b/src/carnot/planner/logical_planner_test.cc @@ -946,7 +946,13 @@ px.export(df, px.otel.Data( px.otel.metric.Gauge( name='resp_latency', value=df.resp_latency_ns, - ) + ), + px.otel.log.Log( + time=df.time_, + severity_number=px.otel.log.SEVERITY_NUMBER_INFO, + severity_text="info", + body=df.service, + ), ] )) )pxl"; @@ -1039,6 +1045,146 @@ px.export(otel_df, px.otel.Data( )))otel"); } +constexpr char kFileSourceQuery[] = R"pxl( +import pxlog +import px + +glob_pattern= '/var/log/kern.log' +table_name='kern.log' +ttl='10m' +pxlog.FileSource(glob_pattern, table_name, ttl) + +df = px.DataFrame(table=table_name) +px.export(df, px.otel.Data( + endpoint=px.otel.Endpoint(url="px.dev:55555"), + resource={ + 'service.name' : df.service, + }, + data=[ + px.otel.metric.Gauge( + name='resp_latency', + value=df.resp_latency_ns, + ) + ] +)) +)pxl"; + +TEST_F(LogicalPlannerTest, FileSourceMutation) { + auto planner = LogicalPlanner::Create(info_).ConsumeValueOrDie(); + auto state = testutils::CreateTwoPEMsOneKelvinPlannerState(testutils::kFileSourceSchema); + plannerpb::CompileMutationsRequest req; + req.set_query_str(kFileSourceQuery); + *req.mutable_logical_planner_state() = state; + auto log_ir_or_s = planner->CompileTrace(req); + ASSERT_OK(log_ir_or_s); + auto log_ir = log_ir_or_s.ConsumeValueOrDie(); + plannerpb::CompileMutationsResponse resp; + ASSERT_OK(log_ir->ToProto(&resp)); + ASSERT_EQ(resp.mutations_size(), 1); + /* EXPECT_THAT(resp.mutations()[0].trace(), EqualsProto(kBPFTwoTraceProgramsPb)); */ +} + +TEST_F(LogicalPlannerTest, FileSourcePlan) { + auto planner = LogicalPlanner::Create(info_).ConsumeValueOrDie(); + auto state = testutils::CreateTwoPEMsOneKelvinPlannerState(testutils::kFileSourceSchema); + // Correspond to the two pems in the planner state + std::vector agent_ids = {1, 2}; + auto plan_or_s = planner->Plan(MakeQueryRequest(state, kFileSourceQuery)); + EXPECT_OK(plan_or_s); + auto plan = plan_or_s.ConsumeValueOrDie(); + EXPECT_OK(plan->ToProto()); + + auto otel_export_matched = false; + auto grpc_sink_matched = false; + for (const auto& id : plan->dag().TopologicalSort()) { + auto subgraph = plan->Get(id)->plan(); + auto otel_export = subgraph->FindNodesOfType(IRNodeType::kOTelExportSink); + auto grpc_sink = subgraph->FindNodesOfType(IRNodeType::kGRPCSink); + if (otel_export.empty() && grpc_sink.empty()) { + continue; + } + if (!otel_export.empty()) { + EXPECT_EQ(1, otel_export.size()); + planpb::Operator op; + auto otel_export_ir = static_cast(otel_export[0]); + EXPECT_OK(otel_export_ir->ToProto(&op)); + EXPECT_EQ(1, op.context().size()); + otel_export_matched = true; + } + if (!grpc_sink.empty()) { + EXPECT_EQ(1, grpc_sink.size()); + for (auto agent_id : agent_ids) { + planpb::Operator op; + auto grpc_sink_ir = static_cast(grpc_sink[0]); + EXPECT_OK(grpc_sink_ir->ToProto(&op, agent_id)); + EXPECT_EQ(1, op.context().size()); + } + grpc_sink_matched = true; + } + } + EXPECT_TRUE(otel_export_matched); + EXPECT_TRUE(grpc_sink_matched); +} + +const char kExplicitStreamId[] = R"pxl( +import px + +df = px.DataFrame(table='http_events', start_time='-6m', mutation_id='mutation') +df.service = df.ctx['service'] +px.export(df, px.otel.Data( + endpoint=px.otel.Endpoint(url="px.dev:55555"), + resource={ + 'service.name' : df.service, + }, + data=[ + px.otel.metric.Gauge( + name='resp_latency', + value=df.resp_latency_ns, + ) + ] +)) +)pxl"; +TEST_F(LogicalPlannerTest, non_mutation_dataframe_with_explicit_stream_id) { + auto state = testutils::CreateTwoPEMsOneKelvinPlannerState(testutils::kHttpEventsSchema); + auto planner = LogicalPlanner::Create(info_).ConsumeValueOrDie(); + // Correspond to the two pems in the planner state + std::vector agent_ids = {1, 2}; + + ASSERT_OK_AND_ASSIGN(auto plan, planner->Plan(MakeQueryRequest(state, kExplicitStreamId))); + ASSERT_OK(plan->ToProto()); + + auto otel_export_matched = false; + auto grpc_sink_matched = false; + for (const auto& id : plan->dag().TopologicalSort()) { + auto subgraph = plan->Get(id)->plan(); + auto otel_export = subgraph->FindNodesOfType(IRNodeType::kOTelExportSink); + auto grpc_sink = subgraph->FindNodesOfType(IRNodeType::kGRPCSink); + if (otel_export.empty() && grpc_sink.empty()) { + continue; + } + if (!otel_export.empty()) { + EXPECT_EQ(1, otel_export.size()); + planpb::Operator op; + auto otel_export_ir = static_cast(otel_export[0]); + EXPECT_OK(otel_export_ir->ToProto(&op)); + EXPECT_EQ(1, op.context().size()); + otel_export_matched = true; + } + if (!grpc_sink.empty()) { + EXPECT_EQ(1, grpc_sink.size()); + for (auto agent_id : agent_ids) { + planpb::Operator op; + auto grpc_sink_ir = static_cast(grpc_sink[0]); + EXPECT_OK(grpc_sink_ir->ToProto(&op, agent_id)); + EXPECT_EQ(1, op.context().size()); + } + grpc_sink_matched = true; + } + } + EXPECT_TRUE(otel_export_matched); + EXPECT_TRUE(grpc_sink_matched); +} + } // namespace planner } // namespace carnot } // namespace px diff --git a/src/carnot/planner/objects/BUILD.bazel b/src/carnot/planner/objects/BUILD.bazel index 060dc6a7888..09dfd062c26 100644 --- a/src/carnot/planner/objects/BUILD.bazel +++ b/src/carnot/planner/objects/BUILD.bazel @@ -37,6 +37,7 @@ pl_cc_library( "//src/carnot/planner/parser:cc_library", "//src/shared/types/typespb/wrapper:cc_library", "@com_github_opentelemetry_proto//:trace_proto_cc", + "@com_github_opentelemetry_proto//:logs_proto_cc", "@com_github_vinzenz_libpypa//:libpypa", ], ) diff --git a/src/carnot/planner/objects/dataframe.cc b/src/carnot/planner/objects/dataframe.cc index 13140b40e17..4548d676a1b 100644 --- a/src/carnot/planner/objects/dataframe.cc +++ b/src/carnot/planner/objects/dataframe.cc @@ -41,15 +41,19 @@ StatusOr> GetAsDataFrame(QLObjectPtr obj) { } StatusOr> Dataframe::Create(CompilerState* compiler_state, - OperatorIR* op, ASTVisitor* visitor) { - std::shared_ptr df(new Dataframe(compiler_state, op, op->graph(), visitor)); + OperatorIR* op, ASTVisitor* visitor, + std::optional mutation_id) { + std::shared_ptr df( + new Dataframe(compiler_state, op, op->graph(), visitor, mutation_id)); PX_RETURN_IF_ERROR(df->Init()); return df; } StatusOr> Dataframe::Create(CompilerState* compiler_state, IR* graph, - ASTVisitor* visitor) { - std::shared_ptr df(new Dataframe(compiler_state, nullptr, graph, visitor)); + ASTVisitor* visitor, + std::optional mutation_id) { + std::shared_ptr df( + new Dataframe(compiler_state, nullptr, graph, visitor, mutation_id)); PX_RETURN_IF_ERROR(df->Init()); return df; } @@ -124,7 +128,23 @@ StatusOr DataFrameConstructor(CompilerState* compiler_state, IR* gr ParseAllTimeFormats(compiler_state->time_now().val, end_time)); mem_source_op->SetTimeStopNS(end_time_ns); } - return Dataframe::Create(compiler_state, mem_source_op, visitor); + StringIR* mutation_id_ir = nullptr; + if (!NoneObject::IsNoneObject(args.GetArg("mutation_id"))) { + PX_ASSIGN_OR_RETURN(mutation_id_ir, GetArgAs(ast, args, "mutation_id")); + } + auto relation_map = compiler_state->relation_map(); + std::optional mutation_id = std::nullopt; + if (mutation_id_ir != nullptr) { + mutation_id = mutation_id_ir->str(); + } + for (const auto& [table_name, relation] : *relation_map) { + if (table_name == table->str() && mutation_id == std::nullopt) { + mutation_id = relation.mutation_id(); + break; + } + } + graph->RecordMutationId(mutation_id); + return Dataframe::Create(compiler_state, mem_source_op, visitor, mutation_id); } StatusOr> ProcessCols(IR* graph, const pypa::AstPtr& ast, QLObjectPtr obj, @@ -174,7 +194,7 @@ StatusOr JoinHandler(CompilerState* compiler_state, IR* graph, Oper PX_ASSIGN_OR_RETURN(JoinIR * join_op, graph->CreateNode(ast, std::vector{op, right}, how_type, left_on_cols, right_on_cols, suffix_strs)); - return Dataframe::Create(compiler_state, join_op, visitor); + return Dataframe::Create(compiler_state, join_op, visitor, graph->mutation_id()); } StatusOr ParseNameTuple(IR* ir, const pypa::AstPtr& ast, @@ -235,7 +255,7 @@ StatusOr AggHandler(CompilerState* compiler_state, IR* graph, Opera PX_ASSIGN_OR_RETURN( BlockingAggIR * agg_op, graph->CreateNode(ast, op, std::vector{}, aggregate_expressions)); - return Dataframe::Create(compiler_state, agg_op, visitor); + return Dataframe::Create(compiler_state, agg_op, visitor, graph->mutation_id()); } StatusOr MapAssignHandler(const pypa::AstPtr& ast, const ParsedArgs&, ASTVisitor*) { @@ -252,7 +272,7 @@ StatusOr DropHandler(CompilerState* compiler_state, IR* graph, Oper PX_ASSIGN_OR_RETURN(std::vector columns, ParseAsListOfStrings(args.GetArg("columns"), "columns")); PX_ASSIGN_OR_RETURN(DropIR * drop_op, graph->CreateNode(ast, op, columns)); - return Dataframe::Create(compiler_state, drop_op, visitor); + return Dataframe::Create(compiler_state, drop_op, visitor, graph->mutation_id()); } // Handles the head() DataFrame logic. @@ -267,7 +287,7 @@ StatusOr LimitHandler(CompilerState* compiler_state, IR* graph, Ope PX_ASSIGN_OR_RETURN(LimitIR * limit_op, graph->CreateNode(ast, op, limit_value, pem_only_val)); - return Dataframe::Create(compiler_state, limit_op, visitor); + return Dataframe::Create(compiler_state, limit_op, visitor, graph->mutation_id()); } class SubscriptHandler { @@ -315,7 +335,7 @@ StatusOr SubscriptHandler::EvalFilter(CompilerState* compiler_state OperatorIR* op, const pypa::AstPtr& ast, ExpressionIR* expr, ASTVisitor* visitor) { PX_ASSIGN_OR_RETURN(FilterIR * filter_op, graph->CreateNode(ast, op, expr)); - return Dataframe::Create(compiler_state, filter_op, visitor); + return Dataframe::Create(compiler_state, filter_op, visitor, graph->mutation_id()); } StatusOr SubscriptHandler::EvalColumn(IR* graph, OperatorIR*, const pypa::AstPtr&, @@ -349,7 +369,7 @@ StatusOr SubscriptHandler::EvalKeep(CompilerState* compiler_state, PX_ASSIGN_OR_RETURN(MapIR * map_op, graph->CreateNode(ast, op, keep_exprs, /* keep_input_columns */ false)); - return Dataframe::Create(compiler_state, map_op, visitor); + return Dataframe::Create(compiler_state, map_op, visitor, graph->mutation_id()); } // Handles the groupby() method. @@ -367,7 +387,7 @@ StatusOr GroupByHandler(CompilerState* compiler_state, IR* graph, O } PX_ASSIGN_OR_RETURN(GroupByIR * group_by_op, graph->CreateNode(ast, op, groups)); - return Dataframe::Create(compiler_state, group_by_op, visitor); + return Dataframe::Create(compiler_state, group_by_op, visitor, graph->mutation_id()); } // Handles the append() dataframe method and creates the union node. @@ -380,7 +400,7 @@ StatusOr UnionHandler(CompilerState* compiler_state, IR* graph, Ope parents.push_back(casted); } PX_ASSIGN_OR_RETURN(UnionIR * union_op, graph->CreateNode(ast, parents)); - return Dataframe::Create(compiler_state, union_op, visitor); + return Dataframe::Create(compiler_state, union_op, visitor, graph->mutation_id()); } // Handles the rolling() dataframe method. @@ -405,7 +425,7 @@ StatusOr RollingHandler(CompilerState* compiler_state, IR* graph, O PX_ASSIGN_OR_RETURN(RollingIR * rolling_op, graph->CreateNode(ast, op, window_col, window_size)); - return Dataframe::Create(compiler_state, rolling_op, visitor); + return Dataframe::Create(compiler_state, rolling_op, visitor, graph->mutation_id()); } /** @@ -416,15 +436,15 @@ StatusOr StreamHandler(CompilerState* compiler_state, IR* graph, Op const pypa::AstPtr& ast, const ParsedArgs&, ASTVisitor* visitor) { PX_ASSIGN_OR_RETURN(StreamIR * stream_op, graph->CreateNode(ast, op)); - return Dataframe::Create(compiler_state, stream_op, visitor); + return Dataframe::Create(compiler_state, stream_op, visitor, graph->mutation_id()); } Status Dataframe::Init() { PX_ASSIGN_OR_RETURN( std::shared_ptr constructor_fn, FuncObject::Create( - name(), {"table", "select", "start_time", "end_time"}, - {{"select", "[]"}, {"start_time", "None"}, {"end_time", "None"}}, + name(), {"table", "select", "start_time", "end_time", "mutation_id"}, + {{"select", "[]"}, {"start_time", "None"}, {"end_time", "None"}, {"mutation_id", "None"}}, /* has_variable_len_args */ false, /* has_variable_len_kwargs */ false, std::bind(&DataFrameConstructor, compiler_state_, graph(), std::placeholders::_1, @@ -628,7 +648,7 @@ StatusOr> Dataframe::FromColumnAssignment(CompilerSta ColExpressionVector map_exprs{{col_name, expr}}; PX_ASSIGN_OR_RETURN(MapIR * ir_node, graph_->CreateNode(expr_node, op(), map_exprs, /*keep_input_cols*/ true)); - return Dataframe::Create(compiler_state, ir_node, ast_visitor()); + return Dataframe::Create(compiler_state, ir_node, ast_visitor(), graph_->mutation_id()); } } // namespace compiler diff --git a/src/carnot/planner/objects/dataframe.h b/src/carnot/planner/objects/dataframe.h index 73f7514ba15..e239e382131 100644 --- a/src/carnot/planner/objects/dataframe.h +++ b/src/carnot/planner/objects/dataframe.h @@ -43,10 +43,12 @@ class Dataframe : public QLObject { /* name */ "DataFrame", /* type */ QLObjectType::kDataframe, }; - static StatusOr> Create(CompilerState* compiler_state, OperatorIR* op, - ASTVisitor* visitor); - static StatusOr> Create(CompilerState* compiler_state, IR* graph, - ASTVisitor* visitor); + static StatusOr> Create( + CompilerState* compiler_state, OperatorIR* op, ASTVisitor* visitor, + std::optional mutation_id = std::nullopt); + static StatusOr> Create( + CompilerState* compiler_state, IR* graph, ASTVisitor* visitor, + std::optional mutation_id = std::nullopt); static bool IsDataframe(const QLObjectPtr& object) { return object->type() == DataframeType.type(); } @@ -430,7 +432,17 @@ class Dataframe : public QLObject { : QLObject(DataframeType, op ? op->ast() : nullptr, visitor), compiler_state_(compiler_state), op_(op), - graph_(graph) {} + graph_(graph), + mutation_id_(std::nullopt) {} + + explicit Dataframe(CompilerState* compiler_state, OperatorIR* op, IR* graph, ASTVisitor* visitor, + std::optional mutation_id) + : QLObject(DataframeType, op ? op->ast() : nullptr, visitor), + compiler_state_(compiler_state), + op_(op), + graph_(graph), + mutation_id_(mutation_id) {} + StatusOr> GetAttributeImpl(const pypa::AstPtr& ast, std::string_view name) const override; @@ -441,6 +453,7 @@ class Dataframe : public QLObject { CompilerState* compiler_state_; OperatorIR* op_ = nullptr; IR* graph_ = nullptr; + std::optional mutation_id_; }; StatusOr> GetAsDataFrame(QLObjectPtr obj); diff --git a/src/carnot/planner/objects/otel.cc b/src/carnot/planner/objects/otel.cc index 7f79d6196bb..78d56b6cc6a 100644 --- a/src/carnot/planner/objects/otel.cc +++ b/src/carnot/planner/objects/otel.cc @@ -18,6 +18,7 @@ #include "src/carnot/planner/objects/otel.h" #include +#include #include #include @@ -39,6 +40,8 @@ namespace carnot { namespace planner { namespace compiler { +using OTelLogRecord = px::carnot::planner::OTelLog; + StatusOr> OTelModule::Create(CompilerState* compiler_state, ASTVisitor* ast_visitor, IR* ir) { auto otel_module = std::shared_ptr(new OTelModule(ast_visitor)); @@ -58,6 +61,12 @@ StatusOr> OTelTrace::Create(ASTVisitor* ast_visitor, return otel_trace; } +StatusOr> OTelLog::Create(ASTVisitor* ast_visitor, IR* graph) { + auto otel_trace = std::shared_ptr(new OTelLog(ast_visitor, graph)); + PX_RETURN_IF_ERROR(otel_trace->Init()); + return otel_trace; +} + StatusOr> EndpointConfig::Create( ASTVisitor* ast_visitor, std::string url, std::vector attributes, bool insecure, int64_t timeout) { @@ -96,7 +105,7 @@ Status ParseEndpointConfig(CompilerState* compiler_state, const QLObjectPtr& end } StatusOr> OTelDataContainer::Create( - ASTVisitor* ast_visitor, std::variant data) { + ASTVisitor* ast_visitor, std::variant data) { return std::shared_ptr(new OTelDataContainer(ast_visitor, std::move(data))); } @@ -249,6 +258,7 @@ StatusOr OTelDataDefinition(CompilerState* compiler_state, const py std::visit(overloaded{ [&otel_data](const OTelMetric& metric) { otel_data.metrics.push_back(metric); }, [&otel_data](const OTelSpan& span) { otel_data.spans.push_back(span); }, + [&otel_data](const OTelLogRecord& log) { otel_data.logs.push_back(log); }, }, container->data()); } @@ -326,6 +336,9 @@ Status OTelModule::Init(CompilerState* compiler_state, IR* ir) { PX_ASSIGN_OR_RETURN(auto trace, OTelTrace::Create(ast_visitor(), ir)); PX_RETURN_IF_ERROR(AssignAttribute("trace", trace)); + PX_ASSIGN_OR_RETURN(auto log, OTelLog::Create(ast_visitor(), ir)); + PX_RETURN_IF_ERROR(AssignAttribute("log", log)); + PX_ASSIGN_OR_RETURN( std::shared_ptr endpoint_fn, FuncObject::Create(kEndpointOpID, {"url", "headers", "insecure", "timeout"}, @@ -466,6 +479,71 @@ Status OTelTrace::Init() { return Status::OK(); } +Status OTelLog::AddSeverityNumberAttributes() { + auto ast = std::make_shared(pypa::AstType::Number); + const google::protobuf::EnumDescriptor* severity_num_desc = ::opentelemetry::proto::logs::v1::SeverityNumber_descriptor(); + if (!severity_num_desc) { + // TODO(ddelnano): return an error + } + for (int i = 0; i < severity_num_desc->value_count(); ++i) { + const google::protobuf::EnumValueDescriptor* value_desc = severity_num_desc->value(i); + PX_ASSIGN_OR_RETURN(IntIR * severity_number, + graph_->CreateNode(ast, static_cast(value_desc->number()))); + PX_ASSIGN_OR_RETURN(auto value, ExprObject::Create(severity_number, ast_visitor())); + PX_RETURN_IF_ERROR(AssignAttribute(value_desc->name(), value)); + } + PX_UNUSED(graph_); + return Status::OK(); +} + +StatusOr LogDefinition(const pypa::AstPtr& ast, const ParsedArgs& args, + ASTVisitor* visitor) { + OTelLogRecord log; + + PX_ASSIGN_OR_RETURN(log.time_column, GetArgAs(ast, args, "time")); + if (!NoneObject::IsNoneObject(args.GetArg("observed_time"))) { + PX_ASSIGN_OR_RETURN(log.observed_time_column, GetArgAs(ast, args, "observed_time")); + } + + PX_ASSIGN_OR_RETURN(log.body_column, GetArgAs(ast, args, "body")); + PX_ASSIGN_OR_RETURN(auto severity_number, GetArgAs(ast, args, "severity_number")); + log.severity_number = severity_number->val(); + + PX_ASSIGN_OR_RETURN(auto severity_text, GetArgAsString(ast, args, "severity_text")); + log.severity_text = severity_text; + + QLObjectPtr attributes = args.GetArg("attributes"); + if (!DictObject::IsDict(attributes)) { + return attributes->CreateError("Expected attributes to be a dictionary, received $0", + attributes->name()); + } + + PX_ASSIGN_OR_RETURN(log.attributes, ParseAttributes(static_cast(attributes.get()))); + + return OTelDataContainer::Create(visitor, std::move(log)); +} + +Status OTelLog::Init() { + // Setup methods. + PX_ASSIGN_OR_RETURN(std::shared_ptr span_fn, + FuncObject::Create(kLogOpID, + {"time", "observed_time", "body", "attributes", "severity_number", "severity_text"}, + {{"observed_time", "None"}, + {"severity_number", "px.otel.log.SEVERITY_NUMBER_INFO"}, + {"severity_text", "info"}, + {"attributes", "{}"}}, + /* has_variable_len_args */ false, + /* has_variable_len_kwargs */ false, + std::bind(&LogDefinition, std::placeholders::_1, + std::placeholders::_2, std::placeholders::_3), + ast_visitor())); + PX_RETURN_IF_ERROR(span_fn->SetDocString(kLogOpDocstring)); + AddMethod(kLogOpID, span_fn); + + PX_RETURN_IF_ERROR(AddSeverityNumberAttributes()); + return Status::OK(); +} + Status EndpointConfig::ToProto(planpb::OTelEndpointConfig* pb) { pb->set_url(url_); for (const auto& attr : attributes_) { diff --git a/src/carnot/planner/objects/otel.h b/src/carnot/planner/objects/otel.h index 5f4c1d19eb7..9ec639ffe37 100644 --- a/src/carnot/planner/objects/otel.h +++ b/src/carnot/planner/objects/otel.h @@ -24,6 +24,7 @@ #include #include "opentelemetry/proto/trace/v1/trace.pb.h" +#include "opentelemetry/proto/logs/v1/logs.pb.h" #include "src/carnot/planner/compiler_state/compiler_state.h" #include "src/carnot/planner/objects/funcobject.h" #include "src/carnot/planpb/plan.pb.h" @@ -212,6 +213,48 @@ class OTelTrace : public QLObject { IR* graph_; }; +class OTelLog : public QLObject { + public: + inline static constexpr char kOTelLogModule[] = "log"; + static constexpr TypeDescriptor OTelLogModuleType = { + /* name */ kOTelLogModule, + /* type */ QLObjectType::kModule, + }; + static StatusOr> Create(ASTVisitor* ast_visitor, IR* graph); + + inline static constexpr char kLogOpID[] = "Log"; + inline static constexpr char kLogOpDocstring[] = R"doc( + Defines the OpenTelemetry Log type. + + Log describes how to transform a pixie DataFrame into the OpenTelemetry + Log type. + + :topic: otel + + Args: + time (Column): The column that marks the timestamp for the log, must be TIME64NS. + observed_time (Column, optional): The column that marks the XXX of the log, must be TIME64NS. + body (Column): The column that contains the log message to emit, must be STRING. + severity_number (int, optional): The OpenTelemetry SeverityNumber enum value to assign for the log, defaults to SEVERITY_NUMBER_INFO if not set. + severity_text (string, optional): The log level associated with the log, defaults to "info" if not set. + if not set. + attributes (Dict[string, Column|string], optional): A mapping of attribute name to a string or the column + that stores data about the attribute. + Returns: + OTelDataContainer: the mapping of DataFrame columns to OpenTelemetry Log fields. Can be passed + into `px.otel.Data()` as the data argument. + )doc"; + + protected: + OTelLog(ASTVisitor* ast_visitor, IR* graph) + : QLObject(OTelLogModuleType, ast_visitor), graph_(graph) {} + Status Init(); + Status AddSeverityNumberAttributes(); + + private: + IR* graph_; +}; + class EndpointConfig : public QLObject { public: struct ConnAttribute { @@ -246,6 +289,7 @@ class EndpointConfig : public QLObject { }; class OTelDataContainer : public QLObject { + using OTelLogRecord = px::carnot::planner::OTelLog; public: static constexpr TypeDescriptor OTelDataContainerType = { /* name */ "OTelDataContainer", @@ -253,20 +297,20 @@ class OTelDataContainer : public QLObject { }; static StatusOr> Create( - ASTVisitor* ast_visitor, std::variant data); + ASTVisitor* ast_visitor, std::variant data); static bool IsOTelDataContainer(const QLObjectPtr& obj) { return obj->type() == OTelDataContainerType.type(); } - const std::variant& data() const { return data_; } + const std::variant& data() const { return data_; } protected: - OTelDataContainer(ASTVisitor* ast_visitor, std::variant data) + OTelDataContainer(ASTVisitor* ast_visitor, std::variant data) : QLObject(OTelDataContainerType, ast_visitor), data_(std::move(data)) {} private: - std::variant data_; + std::variant data_; }; } // namespace compiler diff --git a/src/carnot/planner/objects/otel_test.cc b/src/carnot/planner/objects/otel_test.cc index 97e21cd663e..c1b7fdfcac3 100644 --- a/src/carnot/planner/objects/otel_test.cc +++ b/src/carnot/planner/objects/otel_test.cc @@ -46,9 +46,11 @@ class OTelExportTest : public QLObjectTest { OTelModule::Create(compiler_state.get(), ast_visitor.get(), graph.get())); ASSERT_OK_AND_ASSIGN(auto otelmetric, OTelMetrics::Create(ast_visitor.get(), graph.get())); ASSERT_OK_AND_ASSIGN(auto oteltrace, OTelTrace::Create(ast_visitor.get(), graph.get())); + ASSERT_OK_AND_ASSIGN(auto otellog, OTelLog::Create(ast_visitor.get(), graph.get())); var_table->Add("otel", otel); var_table->Add("otelmetric", otelmetric); var_table->Add("oteltrace", oteltrace); + var_table->Add("otellog", otellog); } StatusOr ParseOutOTelExportIR(const std::string& otel_export_expression, @@ -469,6 +471,101 @@ otel_sink_op { parent_span_id_column_index: 7 kind_value: 2 } +})pb"}, + {"log_basic", + R"pxl( +otel.Data( + endpoint=otel.Endpoint( + url='0.0.0.0:55690', + ), + resource={ + 'service.name' : df.service, + }, + data=[ + otellog.Log( + time=df.start_time, + severity_number=4, + severity_text='info', + body=df.log_message, + ), + ] +))pxl", + table_store::schema::Relation{ + {types::TIME64NS, types::STRING, types::STRING}, + {"start_time", "service", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE}, + }, + R"pb( +op_type: OTEL_EXPORT_SINK_OPERATOR +otel_sink_op { + endpoint_config { + url: "0.0.0.0:55690" + timeout: 5 + } + resource { + attributes { + name: "service.name" + column { + column_type: STRING + column_index: 1 + } + } + } + logs { + time_column_index: 0 + observed_time_column_index: -1 + body_column_index: 2 + severity_number: 4 + severity_text: "info" + } +})pb"}, + {"log_with_observed_time", + R"pxl( +otel.Data( + endpoint=otel.Endpoint( + url='0.0.0.0:55690', + ), + resource={ + 'service.name' : df.service, + }, + data=[ + otellog.Log( + time=df.time_, + observed_time=df.end_time, + severity_number=4, + severity_text='info', + body=df.log_message, + ), + ] +))pxl", + table_store::schema::Relation{ + {types::TIME64NS, types::TIME64NS, types::STRING, types::STRING}, + {"time_", "end_time", "service", "log_message"}, + {types::ST_NONE, types::ST_NONE, types::ST_NONE, types::ST_NONE}, + }, + R"pb( +op_type: OTEL_EXPORT_SINK_OPERATOR +otel_sink_op { + endpoint_config { + url: "0.0.0.0:55690" + timeout: 5 + } + resource { + attributes { + name: "service.name" + column { + column_type: STRING + column_index: 2 + } + } + } + logs { + time_column_index: 0 + observed_time_column_index: 1 + body_column_index: 3 + severity_number: 4 + severity_text: "info" + } })pb"}, {"all_attribute_types", R"pxl( diff --git a/src/carnot/planner/objects/qlobject.h b/src/carnot/planner/objects/qlobject.h index 4231fb78b0e..62733cad776 100644 --- a/src/carnot/planner/objects/qlobject.h +++ b/src/carnot/planner/objects/qlobject.h @@ -66,6 +66,7 @@ enum class QLObjectType { kExporter, kOTelEndpoint, kOTelDataContainer, + kLogModule, }; std::string QLObjectTypeString(QLObjectType type); diff --git a/src/carnot/planner/plannerpb/BUILD.bazel b/src/carnot/planner/plannerpb/BUILD.bazel index 4b73065c498..8fb5c37e0e4 100644 --- a/src/carnot/planner/plannerpb/BUILD.bazel +++ b/src/carnot/planner/plannerpb/BUILD.bazel @@ -28,6 +28,7 @@ pl_proto_library( deps = [ "//src/carnot/planner/distributedpb:distributed_plan_pl_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_proto", + "//src/carnot/planner/file_source/ir:logical_pl_proto", "//src/carnot/planpb:plan_pl_proto", "//src/common/base/statuspb:status_pl_proto", "//src/shared/types/typespb:types_pl_proto", @@ -42,6 +43,7 @@ pl_cc_proto_library( deps = [ "//src/carnot/planner/distributedpb:distributed_plan_pl_cc_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_cc_proto", + "//src/carnot/planner/file_source/ir:logical_pl_cc_proto", "//src/carnot/planpb:plan_pl_cc_proto", "//src/common/base/statuspb:status_pl_cc_proto", "//src/shared/types/typespb/wrapper:cc_library", @@ -56,6 +58,7 @@ pl_go_proto_library( deps = [ "//src/carnot/planner/distributedpb:distributed_plan_pl_go_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", "//src/carnot/planpb:plan_pl_go_proto", "//src/common/base/statuspb:status_pl_go_proto", "//src/shared/types/typespb:types_pl_go_proto", diff --git a/src/carnot/planner/plannerpb/service.pb.go b/src/carnot/planner/plannerpb/service.pb.go index 172eeb1cd81..71eda5ae84a 100755 --- a/src/carnot/planner/plannerpb/service.pb.go +++ b/src/carnot/planner/plannerpb/service.pb.go @@ -17,6 +17,7 @@ import ( math_bits "math/bits" distributedpb "px.dev/pixie/src/carnot/planner/distributedpb" logicalpb "px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb" + ir "px.dev/pixie/src/carnot/planner/file_source/ir" statuspb "px.dev/pixie/src/common/base/statuspb" reflect "reflect" strings "strings" @@ -599,18 +600,63 @@ func (m *ConfigUpdate) GetAgentPodName() string { return "" } +type DeleteFileSource struct { + GlobPattern string `protobuf:"bytes,1,opt,name=glob_pattern,json=globPattern,proto3" json:"glob_pattern,omitempty"` +} + +func (m *DeleteFileSource) Reset() { *m = DeleteFileSource{} } +func (*DeleteFileSource) ProtoMessage() {} +func (*DeleteFileSource) Descriptor() ([]byte, []int) { + return fileDescriptor_710b3465b5cdfdeb, []int{7} +} +func (m *DeleteFileSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteFileSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteFileSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteFileSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFileSource.Merge(m, src) +} +func (m *DeleteFileSource) XXX_Size() int { + return m.Size() +} +func (m *DeleteFileSource) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFileSource.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFileSource proto.InternalMessageInfo + +func (m *DeleteFileSource) GetGlobPattern() string { + if m != nil { + return m.GlobPattern + } + return "" +} + type CompileMutation struct { // Types that are valid to be assigned to Mutation: // *CompileMutation_Trace // *CompileMutation_DeleteTracepoint // *CompileMutation_ConfigUpdate + // *CompileMutation_FileSource + // *CompileMutation_DeleteFileSource Mutation isCompileMutation_Mutation `protobuf_oneof:"mutation"` } func (m *CompileMutation) Reset() { *m = CompileMutation{} } func (*CompileMutation) ProtoMessage() {} func (*CompileMutation) Descriptor() ([]byte, []int) { - return fileDescriptor_710b3465b5cdfdeb, []int{7} + return fileDescriptor_710b3465b5cdfdeb, []int{8} } func (m *CompileMutation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,10 +701,18 @@ type CompileMutation_DeleteTracepoint struct { type CompileMutation_ConfigUpdate struct { ConfigUpdate *ConfigUpdate `protobuf:"bytes,4,opt,name=config_update,json=configUpdate,proto3,oneof" json:"config_update,omitempty"` } +type CompileMutation_FileSource struct { + FileSource *ir.FileSourceDeployment `protobuf:"bytes,5,opt,name=file_source,json=fileSource,proto3,oneof" json:"file_source,omitempty"` +} +type CompileMutation_DeleteFileSource struct { + DeleteFileSource *DeleteFileSource `protobuf:"bytes,6,opt,name=delete_file_source,json=deleteFileSource,proto3,oneof" json:"delete_file_source,omitempty"` +} func (*CompileMutation_Trace) isCompileMutation_Mutation() {} func (*CompileMutation_DeleteTracepoint) isCompileMutation_Mutation() {} func (*CompileMutation_ConfigUpdate) isCompileMutation_Mutation() {} +func (*CompileMutation_FileSource) isCompileMutation_Mutation() {} +func (*CompileMutation_DeleteFileSource) isCompileMutation_Mutation() {} func (m *CompileMutation) GetMutation() isCompileMutation_Mutation { if m != nil { @@ -688,12 +742,28 @@ func (m *CompileMutation) GetConfigUpdate() *ConfigUpdate { return nil } +func (m *CompileMutation) GetFileSource() *ir.FileSourceDeployment { + if x, ok := m.GetMutation().(*CompileMutation_FileSource); ok { + return x.FileSource + } + return nil +} + +func (m *CompileMutation) GetDeleteFileSource() *DeleteFileSource { + if x, ok := m.GetMutation().(*CompileMutation_DeleteFileSource); ok { + return x.DeleteFileSource + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*CompileMutation) XXX_OneofWrappers() []interface{} { return []interface{}{ (*CompileMutation_Trace)(nil), (*CompileMutation_DeleteTracepoint)(nil), (*CompileMutation_ConfigUpdate)(nil), + (*CompileMutation_FileSource)(nil), + (*CompileMutation_DeleteFileSource)(nil), } } @@ -705,7 +775,7 @@ type CompileMutationsResponse struct { func (m *CompileMutationsResponse) Reset() { *m = CompileMutationsResponse{} } func (*CompileMutationsResponse) ProtoMessage() {} func (*CompileMutationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710b3465b5cdfdeb, []int{8} + return fileDescriptor_710b3465b5cdfdeb, []int{9} } func (m *CompileMutationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -756,7 +826,7 @@ type GenerateOTelScriptRequest struct { func (m *GenerateOTelScriptRequest) Reset() { *m = GenerateOTelScriptRequest{} } func (*GenerateOTelScriptRequest) ProtoMessage() {} func (*GenerateOTelScriptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_710b3465b5cdfdeb, []int{9} + return fileDescriptor_710b3465b5cdfdeb, []int{10} } func (m *GenerateOTelScriptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -807,7 +877,7 @@ type GenerateOTelScriptResponse struct { func (m *GenerateOTelScriptResponse) Reset() { *m = GenerateOTelScriptResponse{} } func (*GenerateOTelScriptResponse) ProtoMessage() {} func (*GenerateOTelScriptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_710b3465b5cdfdeb, []int{10} + return fileDescriptor_710b3465b5cdfdeb, []int{11} } func (m *GenerateOTelScriptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -862,6 +932,7 @@ func init() { proto.RegisterType((*CompileMutationsRequest)(nil), "px.carnot.planner.plannerpb.CompileMutationsRequest") proto.RegisterType((*DeleteTracepoint)(nil), "px.carnot.planner.plannerpb.DeleteTracepoint") proto.RegisterType((*ConfigUpdate)(nil), "px.carnot.planner.plannerpb.ConfigUpdate") + proto.RegisterType((*DeleteFileSource)(nil), "px.carnot.planner.plannerpb.DeleteFileSource") proto.RegisterType((*CompileMutation)(nil), "px.carnot.planner.plannerpb.CompileMutation") proto.RegisterType((*CompileMutationsResponse)(nil), "px.carnot.planner.plannerpb.CompileMutationsResponse") proto.RegisterType((*GenerateOTelScriptRequest)(nil), "px.carnot.planner.plannerpb.GenerateOTelScriptRequest") @@ -873,77 +944,82 @@ func init() { } var fileDescriptor_710b3465b5cdfdeb = []byte{ - // 1108 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x51, 0x6f, 0x1b, 0xc5, - 0x13, 0xf7, 0xd9, 0x69, 0x63, 0x8f, 0x9d, 0xfe, 0xd3, 0x4d, 0xfe, 0xe0, 0xba, 0xe2, 0x12, 0x9d, - 0x0a, 0x0a, 0x01, 0xce, 0x90, 0x06, 0x82, 0x2a, 0x01, 0xc2, 0x4d, 0x20, 0x54, 0xa5, 0x84, 0x4b, - 0xda, 0x87, 0xaa, 0xe2, 0x74, 0xbe, 0x9b, 0xb8, 0x27, 0xce, 0x7b, 0xd7, 0xdd, 0xbd, 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0xeb, 0x62, 0xdd, 0x98, 0x35, 0xe6, 0x2a, 0x4e, 0x59, 0x2a, 0xee, - 0x78, 0x5d, 0x24, 0x0e, 0x80, 0xc7, 0x3a, 0xee, 0x63, 0x2f, 0x4a, 0x91, 0xd7, 0x8b, 0xb3, 0xa5, - 0xb9, 0xea, 0xc2, 0x75, 0xfb, 0x04, 0x56, 0xec, 0x43, 0xe0, 0xf6, 0xc7, 0xac, 0x73, 0x4f, 0xfa, - 0x3a, 0x15, 0x2f, 0x93, 0x38, 0xb1, 0x61, 0x2a, 0x4e, 0x45, 0x92, 0x0a, 0x57, 0x78, 0xed, 0x08, - 0xdd, 0x84, 0xe1, 0x66, 0xd8, 0xab, 0x97, 0x54, 0xe8, 0xcb, 0x7a, 0x6b, 0x43, 0xee, 0xac, 0xa9, - 0x8d, 0xc6, 0x22, 0x94, 0x73, 0x18, 0x42, 0x60, 0x6c, 0x20, 0x4f, 0x25, 0x93, 0x69, 0xb8, 0xa0, - 0xf2, 0xab, 0x17, 0x95, 0x52, 0x2f, 0xac, 0xdf, 0xc7, 0x60, 0xfc, 0x66, 0x4c, 0x37, 0xc3, 0x0e, - 0x27, 0x4f, 0x0d, 0x98, 0x8e, 0x05, 0x46, 0x2e, 0xd2, 0x20, 0x89, 0x43, 0x2a, 0x5c, 0x5f, 0xed, - 0x28, 0x98, 0xea, 0xc2, 0xd2, 0x89, 0x07, 0xca, 0x40, 0xec, 0x2f, 0x36, 0x30, 0x5a, 0xc9, 0xfc, - 0xb5, 0xae, 0xf5, 0x52, 0x7f, 0x67, 0x86, 0x1c, 0xd7, 0x3b, 0x44, 0x06, 0x3b, 0xac, 0x23, 0xf7, - 0x60, 0x22, 0x89, 0xd2, 0x4e, 0x48, 0xf3, 0xd8, 0x45, 0x15, 0xfb, 0x9d, 0x91, 0x62, 0xaf, 0x29, - 0xcf, 0x0c, 0xbd, 0x96, 0x0c, 0xac, 0x1a, 0x4f, 0x8b, 0x30, 0x24, 0x05, 0x72, 0x05, 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x5f, 0x4b, 0x82, 0x72, 0xaa, 0x14, 0xa7, 0xea, 0xda, 0x24, 0x27, 0xb7, 0xc8, 0xe0, 0x1b, 0xd4, - 0x98, 0x1f, 0xc5, 0x34, 0x3b, 0xd7, 0xb7, 0x30, 0x79, 0xb4, 0x63, 0xc8, 0xe2, 0x59, 0x2a, 0x9d, - 0x5f, 0xa0, 0x8d, 0x77, 0xcf, 0xe8, 0x95, 0x25, 0xf0, 0xbd, 0x01, 0xe4, 0x38, 0xef, 0xe4, 0xbd, - 0x13, 0xd1, 0x5e, 0xd8, 0x4e, 0x8d, 0xa5, 0x33, 0xfb, 0xe9, 0x3c, 0x5a, 0x1f, 0x6d, 0xef, 0x9a, - 0x85, 0x67, 0xbb, 0x66, 0xe1, 0xf9, 0xae, 0x69, 0x3c, 0xe9, 0x9b, 0xc6, 0x2f, 0x7d, 0xd3, 0xf8, - 0xa3, 0x6f, 0x1a, 0xdb, 0x7d, 0xd3, 0xf8, 0xb3, 0x6f, 0x1a, 0x7f, 0xf7, 0xcd, 0xc2, 0xf3, 0xbe, - 0x69, 0xfc, 0xb0, 0x67, 0x16, 0xb6, 0xf7, 0xcc, 0xc2, 0xb3, 0x3d, 0xb3, 0x70, 0xbf, 0xb2, 0x8f, - 0xdd, 0xbe, 0xa8, 0x7e, 0x9d, 0xaf, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x05, 0x48, 0x4a, - 0x3a, 0x0c, 0x00, 0x00, + // 1191 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xda, 0x69, 0x63, 0x3f, 0x3b, 0x25, 0x9d, 0x16, 0x70, 0x5d, 0xb1, 0x2d, 0xab, 0x82, + 0x4a, 0x81, 0x35, 0xa4, 0xff, 0x50, 0x25, 0x40, 0xb8, 0x69, 0x09, 0x55, 0x29, 0x66, 0x93, 0x56, + 0xa2, 0x2a, 0xac, 0xd6, 0xeb, 0x17, 0x77, 0xc5, 0x7a, 0x76, 0x3b, 0x3b, 0x5b, 0x39, 0x5c, 0x68, + 0x91, 0xb8, 0x23, 0xf1, 0x15, 0x10, 0x42, 0xe2, 0x33, 0x70, 0xe7, 0x98, 0x63, 0x4f, 0x11, 0x71, + 0x24, 0xc4, 0xb1, 0x1f, 0x01, 0xcd, 0x9f, 0x8d, 0xd7, 0x89, 0x9b, 0x38, 0x11, 0x47, 0x4e, 0x99, + 0x79, 0xf3, 0xde, 0xef, 0xbd, 0xfd, 0xfd, 0xe6, 0xcd, 0x73, 0xe0, 0x42, 0xc2, 0xfc, 0xa6, 0xef, + 0x31, 0x1a, 0xf1, 0x66, 0x1c, 0x7a, 0x94, 0x22, 0xcb, 0xfe, 0xc6, 0x9d, 0x66, 0x82, 0xec, 0x71, + 0xe0, 0xa3, 0x1d, 0xb3, 0x88, 0x47, 0xe4, 0x74, 0x3c, 0xb0, 0x95, 0xab, 0xad, 0x5d, 0xec, 0x6d, + 0xd7, 0xc6, 0x87, 0x13, 0x80, 0xba, 0x6b, 0xd4, 0xeb, 0x07, 0xbe, 0xcb, 0x99, 0xe7, 0x07, 0xb4, + 0xd7, 0x0c, 0x58, 0x33, 0x8c, 0x7a, 0x81, 0xef, 0x85, 0x71, 0x27, 0x5b, 0x29, 0xec, 0x46, 0x73, + 0x42, 0xf8, 0x6a, 0x10, 0xa2, 0x9b, 0x44, 0x29, 0xf3, 0x31, 0x17, 0xaa, 0x03, 0xde, 0x90, 0x01, + 0x51, 0xbf, 0x1f, 0xd1, 0x66, 0xc7, 0x4b, 0xb0, 0x99, 0x70, 0x8f, 0xa7, 0x89, 0x28, 0x5a, 0x2e, + 0xb4, 0xdb, 0xc9, 0x5e, 0xd4, 0x8b, 0xe4, 0xb2, 0x29, 0x56, 0xda, 0x7a, 0x75, 0x52, 0xb1, 0x41, + 0xc2, 0x59, 0xd0, 0x49, 0x39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c, 0x39, 0x34, 0x8d, 0xf5, 0xa1, 0x69, 0xfc, 0x35, 0x34, 0x8d, 0x7f, 0x86, 0x66, + 0xe1, 0xf9, 0xd0, 0x34, 0x7e, 0xda, 0x32, 0x0b, 0xeb, 0x5b, 0x66, 0xe1, 0xd9, 0x96, 0x59, 0xb8, + 0x5f, 0xd9, 0xc6, 0xee, 0x1c, 0x95, 0xff, 0x2b, 0x5c, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x30, + 0x6b, 0x7a, 0x93, 0x5c, 0x0d, 0x00, 0x00, } func (this *FuncToExecute) Equal(that interface{}) bool { @@ -1257,6 +1333,30 @@ func (this *ConfigUpdate) Equal(that interface{}) bool { } return true } +func (this *DeleteFileSource) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DeleteFileSource) + if !ok { + that2, ok := that.(DeleteFileSource) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.GlobPattern != that1.GlobPattern { + return false + } + return true +} func (this *CompileMutation) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1359,6 +1459,54 @@ func (this *CompileMutation_ConfigUpdate) Equal(that interface{}) bool { } return true } +func (this *CompileMutation_FileSource) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CompileMutation_FileSource) + if !ok { + that2, ok := that.(CompileMutation_FileSource) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.FileSource.Equal(that1.FileSource) { + return false + } + return true +} +func (this *CompileMutation_DeleteFileSource) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CompileMutation_DeleteFileSource) + if !ok { + that2, ok := that.(CompileMutation_DeleteFileSource) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.DeleteFileSource.Equal(that1.DeleteFileSource) { + return false + } + return true +} func (this *CompileMutationsResponse) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1596,11 +1744,21 @@ func (this *ConfigUpdate) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *DeleteFileSource) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&plannerpb.DeleteFileSource{") + s = append(s, "GlobPattern: "+fmt.Sprintf("%#v", this.GlobPattern)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} func (this *CompileMutation) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 7) + s := make([]string, 0, 9) s = append(s, "&plannerpb.CompileMutation{") if this.Mutation != nil { s = append(s, "Mutation: "+fmt.Sprintf("%#v", this.Mutation)+",\n") @@ -1632,6 +1790,22 @@ func (this *CompileMutation_ConfigUpdate) GoString() string { `ConfigUpdate:` + fmt.Sprintf("%#v", this.ConfigUpdate) + `}`}, ", ") return s } +func (this *CompileMutation_FileSource) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&plannerpb.CompileMutation_FileSource{` + + `FileSource:` + fmt.Sprintf("%#v", this.FileSource) + `}`}, ", ") + return s +} +func (this *CompileMutation_DeleteFileSource) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&plannerpb.CompileMutation_DeleteFileSource{` + + `DeleteFileSource:` + fmt.Sprintf("%#v", this.DeleteFileSource) + `}`}, ", ") + return s +} func (this *CompileMutationsResponse) GoString() string { if this == nil { return "nil" @@ -2323,6 +2497,36 @@ func (m *ConfigUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DeleteFileSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteFileSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteFileSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GlobPattern) > 0 { + i -= len(m.GlobPattern) + copy(dAtA[i:], m.GlobPattern) + i = encodeVarintService(dAtA, i, uint64(len(m.GlobPattern))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *CompileMutation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2418,6 +2622,48 @@ func (m *CompileMutation_ConfigUpdate) MarshalToSizedBuffer(dAtA []byte) (int, e } return len(dAtA) - i, nil } +func (m *CompileMutation_FileSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompileMutation_FileSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FileSource != nil { + { + size, err := m.FileSource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *CompileMutation_DeleteFileSource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompileMutation_DeleteFileSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DeleteFileSource != nil { + { + size, err := m.DeleteFileSource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} func (m *CompileMutationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2766,6 +3012,19 @@ func (m *ConfigUpdate) Size() (n int) { return n } +func (m *DeleteFileSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GlobPattern) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + func (m *CompileMutation) Size() (n int) { if m == nil { return 0 @@ -2814,6 +3073,30 @@ func (m *CompileMutation_ConfigUpdate) Size() (n int) { } return n } +func (m *CompileMutation_FileSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FileSource != nil { + l = m.FileSource.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} +func (m *CompileMutation_DeleteFileSource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DeleteFileSource != nil { + l = m.DeleteFileSource.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} func (m *CompileMutationsResponse) Size() (n int) { if m == nil { return 0 @@ -3015,6 +3298,16 @@ func (this *ConfigUpdate) String() string { }, "") return s } +func (this *DeleteFileSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteFileSource{`, + `GlobPattern:` + fmt.Sprintf("%v", this.GlobPattern) + `,`, + `}`, + }, "") + return s +} func (this *CompileMutation) String() string { if this == nil { return "nil" @@ -3055,6 +3348,26 @@ func (this *CompileMutation_ConfigUpdate) String() string { }, "") return s } +func (this *CompileMutation_FileSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompileMutation_FileSource{`, + `FileSource:` + strings.Replace(fmt.Sprintf("%v", this.FileSource), "FileSourceDeployment", "ir.FileSourceDeployment", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompileMutation_DeleteFileSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompileMutation_DeleteFileSource{`, + `DeleteFileSource:` + strings.Replace(fmt.Sprintf("%v", this.DeleteFileSource), "DeleteFileSource", "DeleteFileSource", 1) + `,`, + `}`, + }, "") + return s +} func (this *CompileMutationsResponse) String() string { if this == nil { return "nil" @@ -4547,6 +4860,88 @@ func (m *ConfigUpdate) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeleteFileSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteFileSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteFileSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobPattern", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GlobPattern = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CompileMutation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4681,6 +5076,76 @@ func (m *CompileMutation) Unmarshal(dAtA []byte) error { } m.Mutation = &CompileMutation_ConfigUpdate{v} iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileSource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ir.FileSourceDeployment{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Mutation = &CompileMutation_FileSource{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteFileSource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DeleteFileSource{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Mutation = &CompileMutation_DeleteFileSource{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) diff --git a/src/carnot/planner/plannerpb/service.proto b/src/carnot/planner/plannerpb/service.proto index a9b33d825f8..0c3b63aad94 100644 --- a/src/carnot/planner/plannerpb/service.proto +++ b/src/carnot/planner/plannerpb/service.proto @@ -23,6 +23,7 @@ package px.carnot.planner.plannerpb; option go_package = "plannerpb"; import "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.proto"; +import "src/carnot/planner/file_source/ir/logical.proto"; import "src/common/base/statuspb/status.proto"; import "gogoproto/gogo.proto"; import "src/carnot/planner/distributedpb/distributed_plan.proto"; @@ -129,6 +130,11 @@ message ConfigUpdate { string agent_pod_name = 3; } +message DeleteFileSource { + // The glob pattern to use to find files to read. Also doubles as the name of the file source. + string glob_pattern = 1; +} + // The definition of a mutation to perfom on Vizier. Mutations include operations // that add and delete tables to the database. message CompileMutation { @@ -140,6 +146,10 @@ message CompileMutation { DeleteTracepoint delete_tracepoint = 3; // Mutation that sets a config. ConfigUpdate config_update = 4; + // Mutation that adds a file source/poller + carnot.planner.file_source.ir.FileSourceDeployment file_source = 5; + // Mutation that deletes a file source/poller + DeleteFileSource delete_file_source = 6; } } diff --git a/src/carnot/planner/probes/BUILD.bazel b/src/carnot/planner/probes/BUILD.bazel index f9fee130715..bd98b0fb8d6 100644 --- a/src/carnot/planner/probes/BUILD.bazel +++ b/src/carnot/planner/probes/BUILD.bazel @@ -37,6 +37,7 @@ pl_cc_library( hdrs = ["probes.h"], deps = [ "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_cc_proto", + "//src/carnot/planner/file_source/ir:logical_pl_cc_proto", "//src/carnot/planner/objects:cc_library", "//src/common/uuid:cc_library", ], diff --git a/src/carnot/planner/probes/probes.cc b/src/carnot/planner/probes/probes.cc index fbe21a674d5..942abab414c 100644 --- a/src/carnot/planner/probes/probes.cc +++ b/src/carnot/planner/probes/probes.cc @@ -108,6 +108,14 @@ std::vector MutationsIR::Deployments() { return deployments; } +std::vector MutationsIR::FileSourceDeployments() { + std::vector file_source_deployments; + for (size_t i = 0; i < file_source_deployments_.size(); i++) { + file_source_deployments.push_back(file_source_deployments_[i]); + } + return file_source_deployments; +} + std::shared_ptr MutationsIR::StartProbe(const std::string& function_name) { auto tracepoint_ir = std::make_shared(function_name); probes_pool_.push_back(tracepoint_ir); @@ -292,15 +300,35 @@ Status MutationsIR::ToProto(plannerpb::CompileMutationsResponse* pb) { pb->add_mutations()->mutable_delete_tracepoint()->set_name(tracepoint_to_delete); } + for (const auto& file_source_to_delete : FileSourcesToDelete()) { + pb->add_mutations()->mutable_delete_file_source()->set_glob_pattern(file_source_to_delete); + } + for (const auto& update : config_updates_) { *(pb->add_mutations()->mutable_config_update()) = update; } + for (const auto& file_source : file_source_deployments_) { + *(pb->add_mutations()->mutable_file_source()) = file_source; + } + return Status::OK(); } void MutationsIR::EndProbe() { current_tracepoint_ = nullptr; } +void MutationsIR::CreateFileSourceDeployment(const std::string& glob_pattern, + const std::string& table_name, int64_t ttl_ns) { + file_source::ir::FileSourceDeployment file_source; + file_source.set_name(glob_pattern); + file_source.set_glob_pattern(glob_pattern); + file_source.set_table_name(table_name); + auto one_sec = std::chrono::duration_cast(std::chrono::seconds(1)); + file_source.mutable_ttl()->set_seconds(ttl_ns / one_sec.count()); + file_source.mutable_ttl()->set_nanos(ttl_ns % one_sec.count()); + file_source_deployments_.push_back(file_source); +} + } // namespace compiler } // namespace planner } // namespace carnot diff --git a/src/carnot/planner/probes/probes.h b/src/carnot/planner/probes/probes.h index 3578cdb33d6..3d90992402b 100644 --- a/src/carnot/planner/probes/probes.h +++ b/src/carnot/planner/probes/probes.h @@ -23,6 +23,7 @@ #include #include "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.pb.h" +#include "src/carnot/planner/file_source/ir/logical.pb.h" #include "src/carnot/planner/objects/funcobject.h" #include "src/carnot/planner/plannerpb/service.pb.h" #include "src/carnot/planner/probes/label_selector_target.h" @@ -166,6 +167,20 @@ class TracepointIR { std::shared_ptr output_ = nullptr; }; +class FileSourceDeployment { + public: + FileSourceDeployment(const std::string& glob_pattern, const std::string& table_name, + int64_t ttl_ns) + : glob_pattern_(glob_pattern), table_name_(table_name), ttl_ns_(ttl_ns) {} + + Status ToProto(file_source::ir::FileSourceDeployment pb) const; + + private: + std::string glob_pattern_; + std::string table_name_; + int64_t ttl_ns_; +}; + class TracepointDeployment { public: TracepointDeployment(const std::string& trace_name, int64_t ttl_ns) @@ -225,6 +240,10 @@ class MutationsIR { */ std::shared_ptr StartProbe(const std::string& function_name); + void CreateFileSourceDeployment(const std::string& glob_pattern, const std::string& table_name, + int64_t ttl_ns); + + void CreateDeleteFileSource(const std::string& glob_pattern); /** * @brief Create a TraceProgram for the MutationsIR w/ the specified UPID. * @@ -331,6 +350,19 @@ class MutationsIR { std::vector Deployments(); + std::vector FileSourceDeployments(); + + /** + * @brief Deletes the file source passed in. + * + * @param file_source_to_delete + */ + void DeleteFileSource(const std::string& file_source_to_delete) { + file_sources_to_delete_.push_back(file_source_to_delete); + } + + const std::vector& FileSourcesToDelete() { return file_sources_to_delete_; } + private: // All the new tracepoints added as part of this mutation. DeploymentSpecs are protobufs because // we only modify these upon inserting the new tracepoint, while the Tracepoint definition is @@ -348,6 +380,9 @@ class MutationsIR { // The updates to internal config that need to be done. std::vector config_updates_; + + std::vector file_source_deployments_; + std::vector file_sources_to_delete_; }; } // namespace compiler diff --git a/src/carnot/planner/probes/tracepoint_generator.cc b/src/carnot/planner/probes/tracepoint_generator.cc index bd2f817b035..3dc23bd2c66 100644 --- a/src/carnot/planner/probes/tracepoint_generator.cc +++ b/src/carnot/planner/probes/tracepoint_generator.cc @@ -28,14 +28,16 @@ #include "src/carnot/planner/probes/probes.h" #include "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.pb.h" +#include "src/carnot/planner/file_source/ir/logical.pb.h" namespace px { namespace carnot { namespace planner { namespace compiler { -StatusOr CompileTracepoint( - std::string_view query) { +namespace { + +StatusOr CompileMutations(std::string_view query) { // Create a compiler state; it doesn't affect the tracepoint compilation. // TODO(oazizi): Try inserting nullptr for registry_info. px::carnot::planner::RegistryInfo registry_info; @@ -65,10 +67,22 @@ StatusOr Co if (pb.mutations_size() != 1) { return error::Internal("Unexpected number of mutations"); } + return pb; +} + +} // namespace +StatusOr CompileTracepoint( + std::string_view query) { + PX_ASSIGN_OR_RETURN(auto pb, CompileMutations(query)); return pb.mutations()[0].trace(); } +StatusOr CompileFileSource(std::string_view query) { + PX_ASSIGN_OR_RETURN(auto pb, CompileMutations(query)); + return pb.mutations()[0].file_source(); +} + } // namespace compiler } // namespace planner } // namespace carnot diff --git a/src/carnot/planner/probes/tracepoint_generator.h b/src/carnot/planner/probes/tracepoint_generator.h index 7cc4a957515..0894d92bbec 100644 --- a/src/carnot/planner/probes/tracepoint_generator.h +++ b/src/carnot/planner/probes/tracepoint_generator.h @@ -33,6 +33,12 @@ namespace compiler { StatusOr CompileTracepoint( std::string_view query); +/** + * Take a file source specification in PXL format, and compiles it to a logical file source + * deployment. + */ +StatusOr CompileFileSource(std::string_view query); + } // namespace compiler } // namespace planner } // namespace carnot diff --git a/src/carnot/planner/test_utils.h b/src/carnot/planner/test_utils.h index 84a5f94c8fe..8ba8af3aabb 100644 --- a/src/carnot/planner/test_utils.h +++ b/src/carnot/planner/test_utils.h @@ -286,6 +286,95 @@ relation_map { } )proto"; +constexpr char kFileSourceSchema[] = R"proto( +relation_map { + key: "kern.log" + value { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_UPID + } + columns { + column_name: "service" + column_type: STRING + column_semantic_type: ST_NONE + } + columns { + column_name: "resp_latency_ns" + column_type: INT64 + column_semantic_type: ST_DURATION_NS + } + mutation_id: "mutation" + } +} +relation_map { + key: "cpu" + value { + columns { + column_name: "count" + column_type: INT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "cpu0" + column_type: FLOAT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "cpu1" + column_type: FLOAT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "cpu2" + column_type: FLOAT64 + column_semantic_type: ST_NONE + } + } +} +relation_map { + key: "process_stats" + value { + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_UPID + } + columns { + column_name: "cpu_ktime_ns" + column_type: INT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "cpu_utime_ns" + column_type: INT64 + column_semantic_type: ST_NONE + } + } +} +relation_map { + key: "only_pem1" + value { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + } +} +)proto"; + constexpr char kConnStatsSchema[] = R"proto( relation_map { key: "conn_stats" @@ -1144,6 +1233,229 @@ schema_info { } )proto"; +constexpr char kThreePEMsOneKelvinAllHasDataStoreDistributedState[] = R"proto( +carnot_info { + query_broker_address: "pem1" + agent_id { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } + has_grpc_server: false + has_data_store: true + processes_data: true + accepts_remote_sources: false + asid: 123 + table_info { + table: "table" + } +} +carnot_info { + query_broker_address: "pem2" + agent_id { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000002 + } + has_grpc_server: false + has_data_store: true + processes_data: true + accepts_remote_sources: false + asid: 789 + table_info { + table: "table" + } +} +carnot_info { + query_broker_address: "pem3" + agent_id { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000003 + } + has_grpc_server: false + has_data_store: true + processes_data: true + accepts_remote_sources: false + asid: 111 + table_info { + table: "table" + } +} +carnot_info { + query_broker_address: "kelvin" + agent_id { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000004 + } + grpc_address: "1111" + has_grpc_server: true + has_data_store: true + processes_data: true + accepts_remote_sources: true + asid: 456 + ssl_targetname: "kelvin.pl.svc" +} +schema_info { + name: "table" + relation { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "cpu_cycles" + column_type: INT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000002 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000003 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000004 + } +} +schema_info { + name: "cql_events" + relation { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + columns { + column_name: "remote_addr" + column_type: STRING + column_semantic_type: ST_NONE + } + columns { + column_name: "remote_port" + column_type: INT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "trace_role" + column_type: INT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "latency" + column_type: INT64 + column_semantic_type: ST_NONE + } + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000002 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000003 + } +} +schema_info { + name: "http_events" + relation { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + columns { + column_name: "local_addr" + column_type: STRING + column_semantic_type: ST_NONE + } + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000002 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000003 + } +} +schema_info { + name: "process_stats" + relation { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000002 + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000003 + } +} +schema_info { + name: "only_pem1" + relation { + columns { + column_name: "time_" + column_type: TIME64NS + column_semantic_type: ST_NONE + } + columns { + column_name: "upid" + column_type: UINT128 + column_semantic_type: ST_NONE + } + } + agent_list { + high_bits: 0x0000000100000000 + low_bits: 0x0000000000000001 + } +} +)proto"; + constexpr char kOnePEMOneKelvinDistributedState[] = R"proto( carnot_info { agent_id { diff --git a/src/carnot/planpb/plan.pb.go b/src/carnot/planpb/plan.pb.go index ce6671091c1..ef00e006fa3 100755 --- a/src/carnot/planpb/plan.pb.go +++ b/src/carnot/planpb/plan.pb.go @@ -526,7 +526,8 @@ type Operator struct { // *Operator_UdtfSourceOp // *Operator_EmptySourceOp // *Operator_OTelSinkOp - Op isOperator_Op `protobuf_oneof:"op"` + Op isOperator_Op `protobuf_oneof:"op"` + Context map[string]string `protobuf:"bytes,15,rep,name=context,proto3" json:"context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *Operator) Reset() { *m = Operator{} } @@ -727,6 +728,13 @@ func (m *Operator) GetOTelSinkOp() *OTelExportSinkOperator { return nil } +func (m *Operator) GetContext() map[string]string { + if m != nil { + return m.Context + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Operator) XXX_OneofWrappers() []interface{} { return []interface{}{ @@ -3238,6 +3246,7 @@ func init() { proto.RegisterType((*DAG_DAGNode)(nil), "px.carnot.planpb.DAG.DAGNode") proto.RegisterType((*PlanNode)(nil), "px.carnot.planpb.PlanNode") proto.RegisterType((*Operator)(nil), "px.carnot.planpb.Operator") + proto.RegisterMapType((map[string]string)(nil), "px.carnot.planpb.Operator.ContextEntry") proto.RegisterType((*MemorySourceOperator)(nil), "px.carnot.planpb.MemorySourceOperator") proto.RegisterType((*MemorySinkOperator)(nil), "px.carnot.planpb.MemorySinkOperator") proto.RegisterType((*GRPCSourceOperator)(nil), "px.carnot.planpb.GRPCSourceOperator") @@ -3278,213 +3287,216 @@ func init() { func init() { proto.RegisterFile("src/carnot/planpb/plan.proto", fileDescriptor_e5dcfc8666ec3f33) } var fileDescriptor_e5dcfc8666ec3f33 = []byte{ - // 3294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x39, 0x4b, 0x6c, 0x1b, 0xc7, - 0xd9, 0x5c, 0x92, 0xe2, 0xe3, 0xe3, 0x53, 0x63, 0xc9, 0x96, 0x69, 0x9b, 0x72, 0x18, 0xfb, 0xb7, - 0xe2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 0xa0, 0x07, 0xba, - 0x00, 0xc0, 0xcc, 0x90, 0x03, 0x69, 0x96, 0x65, 0x90, 0x8d, 0xff, 0x9a, 0x5c, 0xab, 0xfc, 0x3f, - 0x4c, 0x46, 0x3a, 0x20, 0x62, 0x8e, 0x94, 0x22, 0xe6, 0xc8, 0xf9, 0x02, 0xe4, 0x02, 0x53, 0xf1, - 0x6a, 0x32, 0x13, 0x2f, 0x27, 0x6a, 0x0f, 0x20, 0x17, 0x98, 0x1b, 0xd0, 0x22, 0xe4, 0xc8, 0x9e, - 0x45, 0x73, 0x87, 0x85, 0x86, 0x0f, 0x7a, 0x11, 0x27, 0xd1, 0x56, 0x57, 0xe9, 0x29, 0x76, 0x73, - 0x40, 0x8a, 0x83, 0x6c, 0x27, 0x49, 0xe4, 0x5f, 0xc7, 0x61, 0x3c, 0x34, 0x78, 0xa0, 0xd7, 0x20, - 0xf5, 0x80, 0x36, 0x1a, 0x7f, 0xe7, 0xcb, 0xcf, 0x98, 0x56, 0x02, 0x9b, 0x0b, 0x26, 0x74, 0x0d, - 0x52, 0x9a, 0x6d, 0x7a, 0x96, 0x7f, 0xad, 0x99, 0x0a, 0xb3, 0x2f, 0x30, 0x1d, 0xb0, 0xa0, 0xa3, - 0x7d, 0x9b, 0x3d, 0x8d, 0x44, 0x10, 0x18, 0x88, 0x07, 0x70, 0x1a, 0x72, 0x4c, 0xb8, 0x20, 0x48, - 0x72, 0x02, 0x06, 0xe2, 0x04, 0x15, 0xc8, 0x3c, 0xd4, 0x0d, 0xd5, 0x7c, 0x48, 0x54, 0x96, 0xc9, - 0x19, 0x3c, 0x58, 0x53, 0x66, 0x4b, 0xb1, 0x5d, 0x5d, 0xe9, 0xc9, 0x8a, 0xa6, 0xb1, 0x06, 0x9b, - 0xc1, 0x20, 0x40, 0x0d, 0x4d, 0x43, 0x2f, 0x40, 0x79, 0x57, 0x37, 0x94, 0x9e, 0xfe, 0x01, 0x91, - 0x6d, 0x96, 0xaf, 0x0e, 0xeb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0x7a, 0xba, 0xbb, 0x2f, - 0x77, 0x4d, 0x43, 0xd5, 0x79, 0x0f, 0xe6, 0x7e, 0xb8, 0x76, 0x8c, 0xac, 0xa6, 0xe0, 0x5c, 0xf0, - 0x19, 0x31, 0x22, 0x87, 0x41, 0x0e, 0xc2, 0x50, 0x14, 0x47, 0x87, 0x1f, 0x7d, 0x7e, 0xd3, 0xfc, - 0xdf, 0x63, 0xa4, 0xf3, 0xfb, 0x9e, 0x48, 0x88, 0x02, 0x17, 0xb1, 0x20, 0xd2, 0xe2, 0x70, 0x74, - 0x93, 0xe1, 0xe8, 0x86, 0xa3, 0x30, 0x16, 0x11, 0x85, 0x3e, 0x8c, 0x87, 0xac, 0x40, 0x57, 0x61, - 0xbc, 0x47, 0x76, 0x7d, 0x7d, 0x79, 0x38, 0xc4, 0xdd, 0xb1, 0x44, 0x11, 0x0b, 0xc3, 0x80, 0xa0, - 0x17, 0x01, 0xd9, 0xba, 0x76, 0xef, 0x10, 0x71, 0x9c, 0x11, 0x97, 0x19, 0x26, 0x40, 0x5d, 0xe9, - 0x40, 0x3e, 0x68, 0x16, 0xb5, 0x83, 0xdf, 0x75, 0x47, 0x36, 0xc9, 0x71, 0x18, 0xdf, 0x60, 0x68, - 0x6a, 0x50, 0x74, 0x2e, 0x90, 0x14, 0xb5, 0x97, 0x21, 0xe3, 0x87, 0x15, 0x65, 0x61, 0xac, 0xb5, - 0xb1, 0xd1, 0xc4, 0xe5, 0x18, 0x2a, 0x02, 0xac, 0x35, 0x97, 0x3a, 0x72, 0x7b, 0xbb, 0xd3, 0xc4, - 0x65, 0x89, 0xae, 0x97, 0xb6, 0xd7, 0xd6, 0xc4, 0x3a, 0x51, 0xdb, 0x05, 0x14, 0x1e, 0xd6, 0x23, - 0x87, 0xaf, 0xbb, 0x00, 0x8a, 0xad, 0xc9, 0xa2, 0x17, 0xc7, 0x8f, 0xba, 0xee, 0xf3, 0xce, 0x22, - 0xa6, 0x4a, 0xc5, 0xd6, 0xd8, 0x93, 0x53, 0x33, 0xe1, 0x54, 0xc4, 0x14, 0x7f, 0x92, 0x0a, 0xfd, - 0x66, 0x07, 0x71, 0xed, 0x57, 0x71, 0x48, 0xd3, 0x69, 0x7e, 0xcd, 0xd4, 0xd0, 0xeb, 0x00, 0x8a, - 0xeb, 0xda, 0xfa, 0x8e, 0xe7, 0x0e, 0x8e, 0x91, 0xe9, 0xe8, 0x8b, 0x41, 0xc3, 0xa7, 0xc3, 0x01, - 0x16, 0x9a, 0x0c, 0x74, 0x1c, 0x0e, 0xc7, 0x37, 0x81, 0x4b, 0x14, 0x11, 0x4c, 0x86, 0x57, 0xa1, - 0x62, 0xee, 0x38, 0xc4, 0x7e, 0x40, 0x54, 0x39, 0xcc, 0x94, 0x60, 0x4c, 0x67, 0x7c, 0x8a, 0xce, - 0x21, 0xe6, 0x2b, 0x50, 0x72, 0xc8, 0x03, 0x62, 0xd3, 0x52, 0x34, 0xbc, 0xfe, 0x0e, 0xb1, 0xc5, - 0xbb, 0xbe, 0xa2, 0x0f, 0xde, 0x60, 0x50, 0xf4, 0x3c, 0x14, 0x06, 0x84, 0x2e, 0xd9, 0x73, 0x59, - 0x62, 0x67, 0x71, 0xde, 0x07, 0x76, 0xc8, 0x9e, 0x4b, 0xd5, 0xde, 0x31, 0xd5, 0xfd, 0x51, 0x0d, - 0x52, 0x5c, 0x6d, 0x8a, 0x08, 0xec, 0x5c, 0xfb, 0x28, 0x09, 0x19, 0x76, 0xfb, 0xb1, 0x14, 0x9a, - 0x92, 0x39, 0x1a, 0x0f, 0xd9, 0x71, 0x6d, 0x3a, 0xb3, 0xb3, 0x34, 0xa0, 0x17, 0x22, 0x0a, 0xdc, - 0x62, 0x30, 0xf4, 0x22, 0x8c, 0x33, 0x92, 0xb0, 0x4b, 0x56, 0x62, 0xb8, 0x44, 0x51, 0x41, 0xbb, - 0x46, 0x23, 0x90, 0xf8, 0xfa, 0x11, 0x58, 0x84, 0x49, 0xd7, 0x56, 0xd8, 0xbc, 0x3a, 0xba, 0x25, - 0x73, 0xcf, 0xfc, 0xf8, 0xc1, 0xe3, 0xe9, 0x42, 0x87, 0x12, 0xb4, 0x16, 0x45, 0xb7, 0x40, 0x8c, - 0xbe, 0xa5, 0x06, 0xd5, 0x68, 0xc0, 0x84, 0x63, 0x29, 0x46, 0x48, 0xc8, 0x18, 0x13, 0xc2, 0x26, - 0x60, 0x6a, 0xff, 0x40, 0xc6, 0x38, 0xa5, 0x1e, 0x15, 0xd1, 0x81, 0x73, 0xa2, 0x5a, 0x23, 0x25, - 0x31, 0xef, 0xce, 0x9f, 0x3e, 0x78, 0x3c, 0x8d, 0x78, 0x91, 0x8f, 0xc8, 0x3b, 0x63, 0x0d, 0x61, - 0x23, 0x52, 0x5f, 0x86, 0x33, 0xc3, 0x0b, 0xdb, 0xa8, 0xc4, 0x34, 0x8b, 0xd7, 0xc4, 0xe0, 0x82, - 0x16, 0x64, 0xbb, 0x0e, 0x93, 0xc4, 0x88, 0x4a, 0xb3, 0x0c, 0x63, 0x42, 0xc4, 0x08, 0x65, 0xd8, - 0x05, 0x80, 0xfb, 0xba, 0xa1, 0xf2, 0x3a, 0x66, 0x6f, 0x2d, 0x12, 0x38, 0x4b, 0x21, 0xac, 0x50, - 0xe7, 0x53, 0xbc, 0xf2, 0x6b, 0xdf, 0x87, 0x12, 0x0d, 0xc6, 0x3a, 0x71, 0x6d, 0xbd, 0xbb, 0xac, - 0x78, 0x1a, 0x41, 0x75, 0x40, 0xbb, 0x3d, 0x53, 0x89, 0x68, 0x89, 0x34, 0xe4, 0x65, 0x86, 0x0b, - 0xee, 0x74, 0x15, 0xca, 0xba, 0xe1, 0x46, 0x27, 0x48, 0x51, 0x37, 0x82, 0xb4, 0xf3, 0x45, 0xc8, - 0xf3, 0x91, 0x8a, 0x53, 0xd7, 0x7e, 0x19, 0x87, 0xf1, 0xe1, 0xfe, 0x5b, 0x5e, 0xbf, 0xaf, 0xd8, - 0xfb, 0xb4, 0xcf, 0x76, 0x4d, 0xcf, 0x88, 0xd2, 0x00, 0x97, 0x19, 0x26, 0xb8, 0xff, 0x0c, 0x94, - 0x1d, 0xaf, 0x1f, 0x55, 0xb3, 0x45, 0xc7, 0xeb, 0x07, 0x29, 0xdf, 0x85, 0xd2, 0xfb, 0x1e, 0x9d, - 0xaa, 0x7b, 0xc4, 0xef, 0x6f, 0x3c, 0x45, 0x6f, 0x44, 0xa7, 0xe8, 0x88, 0x56, 0x75, 0xe6, 0xb8, - 0x86, 0xfb, 0x2d, 0x21, 0x01, 0x17, 0x7d, 0x59, 0xbc, 0xf5, 0x55, 0xbe, 0x0b, 0xa5, 0x43, 0x24, - 0x74, 0x40, 0xf4, 0x89, 0x98, 0xfa, 0x12, 0x1e, 0xac, 0xa9, 0x91, 0x41, 0x57, 0x8c, 0x28, 0x5e, - 0x66, 0x98, 0x60, 0xd9, 0x7e, 0x12, 0x87, 0xc2, 0x48, 0xd5, 0x44, 0xf6, 0xee, 0x37, 0x20, 0xc5, - 0xa5, 0x1d, 0xfd, 0xc2, 0x71, 0x44, 0x88, 0x18, 0x6e, 0x56, 0x62, 0x58, 0xf0, 0xa1, 0xe7, 0x21, - 0xcf, 0x9b, 0x81, 0x48, 0x9c, 0x84, 0x68, 0x09, 0x39, 0x0e, 0x65, 0x06, 0x56, 0x7e, 0x2e, 0x41, - 0x4a, 0x1c, 0x6a, 0x37, 0x06, 0x2f, 0x3f, 0x02, 0x73, 0x49, 0x54, 0xd3, 0x86, 0x61, 0xd3, 0x8e, - 0x3c, 0xe6, 0x12, 0x23, 0xc7, 0x1c, 0xba, 0x0d, 0x67, 0xbb, 0x8a, 0x21, 0xef, 0x10, 0xf9, 0x3d, - 0xc7, 0x34, 0x64, 0x62, 0x74, 0x4d, 0x95, 0xa8, 0xb2, 0x62, 0xdb, 0xca, 0xbe, 0xf8, 0x84, 0x32, - 0xd9, 0x55, 0x8c, 0x79, 0xb2, 0xea, 0x98, 0x46, 0x93, 0x63, 0x1b, 0x14, 0x39, 0x9f, 0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0x02, 0x4a, 0x4b, 0xad, 0xb5, 0x4e, 0x13, 0x0f, 0xa1, 0x3f, 0x1b, 0x47, 0xa7, 0xa0, - 0xb8, 0xd6, 0x5a, 0x6f, 0x75, 0x86, 0xc0, 0x7f, 0x30, 0xe0, 0xf6, 0x46, 0xab, 0xbd, 0x31, 0x04, - 0x7e, 0x81, 0x10, 0x82, 0xc2, 0x6a, 0xbb, 0x15, 0x80, 0xfd, 0xe1, 0x14, 0x55, 0xdb, 0x37, 0xb7, - 0xb5, 0xf1, 0xe6, 0x10, 0xf5, 0xf1, 0x12, 0xd5, 0x83, 0x1b, 0x3b, 0x82, 0xf8, 0x68, 0x19, 0x55, - 0xe1, 0x6c, 0xbb, 0xd3, 0x5c, 0x93, 0x9b, 0xdf, 0xde, 0x6c, 0xe3, 0xce, 0x21, 0xfc, 0x57, 0xcb, - 0xf3, 0x77, 0x1f, 0x3d, 0xa9, 0xc6, 0x3e, 0x7f, 0x52, 0x8d, 0x7d, 0xf5, 0xa4, 0x2a, 0x7d, 0x78, - 0x50, 0x95, 0x3e, 0x3e, 0xa8, 0x4a, 0x7f, 0x3c, 0xa8, 0x4a, 0x8f, 0x0e, 0xaa, 0xd2, 0x17, 0x07, - 0x55, 0xe9, 0xe9, 0x41, 0x35, 0xf6, 0xd5, 0x41, 0x55, 0xfa, 0xc9, 0x97, 0xd5, 0xd8, 0xa3, 0x2f, - 0xab, 0xb1, 0xcf, 0xbf, 0xac, 0xc6, 0xbe, 0x93, 0xe2, 0xa1, 0xdf, 0x49, 0xb1, 0xef, 0x59, 0x37, - 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xa5, 0x24, 0xbc, 0x5d, 0x24, 0x00, 0x00, + // 3333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0x4d, 0x6c, 0x1b, 0x47, + 0x96, 0x66, 0x93, 0x14, 0x7f, 0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4f, + 0xec, 0x90, 0x03, 0x97, 0xaa, 0xbd, 0x67, 0xaa, 0x87, 0xa3, 0x1a, 0xa4, 0xb8, 0xda, 0x74, 0x22, + 0xb0, 0x72, 0xed, 0xb3, 0x24, 0x64, 0xd8, 0xe5, 0xcb, 0x52, 0x68, 0x4a, 0xe6, 0x68, 0x3c, 0x64, + 0xc7, 0xb5, 0x69, 0xcf, 0xce, 0xd2, 0x80, 0xde, 0xc7, 0x28, 0x71, 0x87, 0xd1, 0xd0, 0xab, 0x30, + 0xc9, 0x20, 0x61, 0x97, 0xac, 0xc5, 0x70, 0x89, 0x4e, 0x05, 0xed, 0x1a, 0x8d, 0x40, 0xe2, 0xfb, + 0x47, 0x60, 0x19, 0xa6, 0x5d, 0x5b, 0x61, 0xfd, 0xea, 0xe8, 0x92, 0xcc, 0x3d, 0x8b, 0x93, 0x47, + 0x4f, 0x67, 0x0b, 0x1d, 0x0a, 0x68, 0x2d, 0x8b, 0x6a, 0x81, 0x18, 0xbe, 0xa5, 0x06, 0xd5, 0x68, + 0xc0, 0x94, 0x63, 0x29, 0x46, 0x48, 0xc8, 0x04, 0x13, 0xc2, 0x3a, 0x60, 0x6a, 0xff, 0x40, 0xc6, + 0x24, 0x45, 0x8f, 0x8a, 0xe8, 0xc0, 0x05, 0xb1, 0x5b, 0x23, 0x25, 0x31, 0xef, 0x2e, 0x9e, 0x3d, + 0x7a, 0x3a, 0x8b, 0xf8, 0x26, 0x1f, 0x91, 0x77, 0xce, 0x1a, 0xd2, 0x46, 0xa4, 0xbe, 0x0e, 0xe7, + 0x86, 0x17, 0xb6, 0x51, 0x89, 0x69, 0x16, 0xaf, 0xa9, 0xc1, 0x05, 0x2d, 0xc8, 0x76, 0x13, 0xa6, + 0x89, 0x11, 0x95, 0x66, 0x19, 0xc6, 0x84, 0x88, 0x11, 0xca, 0xb0, 0x4b, 0x00, 0x0f, 0x75, 0x43, + 0xe5, 0xfb, 0x98, 0x3d, 0x9a, 0x24, 0x70, 0x96, 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a, 0xec, 0xeb, 0x6f, 0xab, 0xb1, 0x7f, 0x4a, 0xf1, + 0xd0, 0xef, 0xa5, 0xd8, 0xf7, 0xac, 0x5b, 0x7f, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xb9, 0x47, + 0x05, 0xdc, 0x24, 0x00, 0x00, } func (x OperatorType) String() string { @@ -3771,6 +3783,14 @@ func (this *Operator) Equal(that interface{}) bool { } else if !this.Op.Equal(that1.Op) { return false } + if len(this.Context) != len(that1.Context) { + return false + } + for i := range this.Context { + if this.Context[i] != that1.Context[i] { + return false + } + } return true } func (this *Operator_MemSourceOp) Equal(that interface{}) bool { @@ -6005,12 +6025,25 @@ func (this *Operator) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 18) + s := make([]string, 0, 19) s = append(s, "&planpb.Operator{") s = append(s, "OpType: "+fmt.Sprintf("%#v", this.OpType)+",\n") if this.Op != nil { s = append(s, "Op: "+fmt.Sprintf("%#v", this.Op)+",\n") } + keysForContext := make([]string, 0, len(this.Context)) + for k, _ := range this.Context { + keysForContext = append(keysForContext, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForContext) + mapStringForContext := "map[string]string{" + for _, k := range keysForContext { + mapStringForContext += fmt.Sprintf("%#v: %#v,", k, this.Context[k]) + } + mapStringForContext += "}" + if this.Context != nil { + s = append(s, "Context: "+mapStringForContext+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -7190,6 +7223,25 @@ func (m *Operator) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } } + if len(m.Context) > 0 { + for k := range m.Context { + v := m.Context[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintPlan(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintPlan(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintPlan(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x7a + } + } if m.OpType != 0 { i = encodeVarintPlan(dAtA, i, uint64(m.OpType)) i-- @@ -9871,6 +9923,14 @@ func (m *Operator) Size() (n int) { if m.Op != nil { n += m.Op.Size() } + if len(m.Context) > 0 { + for k, v := range m.Context { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovPlan(uint64(len(k))) + 1 + len(v) + sovPlan(uint64(len(v))) + n += mapEntrySize + 1 + sovPlan(uint64(mapEntrySize)) + } + } return n } @@ -11172,9 +11232,20 @@ func (this *Operator) String() string { if this == nil { return "nil" } + keysForContext := make([]string, 0, len(this.Context)) + for k, _ := range this.Context { + keysForContext = append(keysForContext, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForContext) + mapStringForContext := "map[string]string{" + for _, k := range keysForContext { + mapStringForContext += fmt.Sprintf("%v: %v,", k, this.Context[k]) + } + mapStringForContext += "}" s := strings.Join([]string{`&Operator{`, `OpType:` + fmt.Sprintf("%v", this.OpType) + `,`, `Op:` + fmt.Sprintf("%v", this.Op) + `,`, + `Context:` + mapStringForContext + `,`, `}`, }, "") return s @@ -13522,6 +13593,133 @@ func (m *Operator) Unmarshal(dAtA []byte) error { } m.Op = &Operator_OTelSinkOp{v} iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPlan + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPlan + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthPlan + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthPlan + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPlan + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthPlan + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthPlan + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipPlan(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPlan + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Context[mapkey] = mapvalue + iNdEx = postIndex case 1000: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GRPCSinkOp", wireType) diff --git a/src/carnot/planpb/plan.proto b/src/carnot/planpb/plan.proto index c7bcb552dda..e1f91935fa7 100644 --- a/src/carnot/planpb/plan.proto +++ b/src/carnot/planpb/plan.proto @@ -115,6 +115,7 @@ enum OperatorType { MEMORY_SINK_OPERATOR = 9000; GRPC_SINK_OPERATOR = 9100; OTEL_EXPORT_SINK_OPERATOR = 9200; + // TODO(ddelnano): 10001 - 11000 are reserved for future use (sink_results table) } // The Logical operation performed. Each operator needs and entry in this @@ -150,6 +151,7 @@ message Operator { // OTelExportSinkOperator writes the input table to an OpenTelemetry endpoint. OTelExportSinkOperator otel_sink_op = 14 [ (gogoproto.customname) = "OTelSinkOp" ]; } + map context = 15; } // Fetches data from in-memory source. diff --git a/src/carnot/planpb/test_proto.h b/src/carnot/planpb/test_proto.h index 0ca5a1c37a4..a8a6cf14745 100644 --- a/src/carnot/planpb/test_proto.h +++ b/src/carnot/planpb/test_proto.h @@ -1024,6 +1024,72 @@ constexpr char kPlanWithTwoSourcesWithLimits[] = R"proto( } )proto"; +constexpr char kPlanWithOTelExport[] = R"proto( + id: 1, + dag { + nodes { + id: 1 + sorted_children: 2 + } + nodes { + id: 2 + sorted_parents: 1 + } + } + nodes { + id: 1 + op { + op_type: MEMORY_SOURCE_OPERATOR + context: { + key: "mutation_id" + value: "mutation" + } + mem_source_op { + name: "numbers" + column_idxs: 0 + column_types: INT64 + column_names: "a" + column_idxs: 1 + column_types: BOOLEAN + column_names: "b" + column_idxs: 2 + column_types: FLOAT64 + column_names: "c" + } + } + } + nodes { + id: 2 + op { + op_type: OTEL_EXPORT_SINK_OPERATOR + context: { + key: "mutation_id" + value: "mutation" + } + otel_sink_op { + endpoint_config { + url: "0.0.0.0:55690" + headers { + key: "apikey" + value: "12345" + } + timeout: 5 + } + resource { + attributes { + name: "service.name" + column { + column_type: STRING + column_index: 1 + can_be_json_encoded_array: true + } + } + } + } + } + } +)proto"; + constexpr char kOneLimit3Sources[] = R"proto( id: 1, dag { diff --git a/src/common/json/json.h b/src/common/json/json.h index 7dab5ceef7e..d4e38338d2d 100644 --- a/src/common/json/json.h +++ b/src/common/json/json.h @@ -126,6 +126,27 @@ std::string ToJSONString(const T& x) { return sb.GetString(); } +inline std::string RapidJSONTypeToString(rapidjson::Type type) { + switch (type) { + case rapidjson::kNullType: + return "Null"; + case rapidjson::kFalseType: + return "False"; + case rapidjson::kTrueType: + return "True"; + case rapidjson::kObjectType: + return "Object"; + case rapidjson::kArrayType: + return "Array"; + case rapidjson::kStringType: + return "String"; + case rapidjson::kNumberType: + return "Number"; + default: + return "Unknown"; + } +} + /* * Exposes a limited set of APIs to build JSON string, with mixed data structures; which could not * be processed by the above ToJSONString(). diff --git a/src/common/testing/protobuf.h b/src/common/testing/protobuf.h index dfd6091a4e6..07da54be26a 100644 --- a/src/common/testing/protobuf.h +++ b/src/common/testing/protobuf.h @@ -66,7 +66,7 @@ struct ProtoMatcher { } virtual void DescribeTo(::std::ostream* os) const { - *os << "equals to text probobuf: " << expected_text_pb_; + *os << "equals to text protobuf: " << expected_text_pb_; } virtual void DescribeNegationTo(::std::ostream* os) const { @@ -97,7 +97,7 @@ struct PartiallyEqualsProtoMatcher : public ProtoMatcher { } void DescribeTo(::std::ostream* os) const override { - *os << "partially equals to text probobuf: " << expected_text_pb_; + *os << "partially equals to text protobuf: " << expected_text_pb_; } void DescribeNegationTo(::std::ostream* os) const override { diff --git a/src/common/uuid/uuid_utils.h b/src/common/uuid/uuid_utils.h index 90207d75491..792a79453e3 100644 --- a/src/common/uuid/uuid_utils.h +++ b/src/common/uuid/uuid_utils.h @@ -49,6 +49,10 @@ inline void ClearUUID(sole::uuid* uuid) { uuid->cd = 0; } +inline bool operator==(const px::uuidpb::UUID& lhs, const px::uuidpb::UUID& rhs) { + return lhs.low_bits() == rhs.low_bits() && lhs.high_bits() == rhs.high_bits(); +} + } // namespace px // Allow UUID to be logged. diff --git a/src/experimental/standalone_pem/file_source_manager.cc b/src/experimental/standalone_pem/file_source_manager.cc new file mode 100644 index 00000000000..11727480abd --- /dev/null +++ b/src/experimental/standalone_pem/file_source_manager.cc @@ -0,0 +1,195 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include "src/common/base/base.h" +#include "src/experimental/standalone_pem/file_source_manager.h" + +constexpr auto kUpdateInterval = std::chrono::seconds(2); + +namespace px { +namespace vizier { +namespace agent { + +FileSourceManager::FileSourceManager(px::event::Dispatcher* dispatcher, + stirling::Stirling* stirling, + table_store::TableStore* table_store) + : dispatcher_(dispatcher), stirling_(stirling), table_store_(table_store) { + file_source_monitor_timer_ = + dispatcher_->CreateTimer(std::bind(&FileSourceManager::Monitor, this)); + // Kick off the background monitor. + file_source_monitor_timer_->EnableTimer(kUpdateInterval); +} + +std::string FileSourceManager::DebugString() const { + std::lock_guard lock(mu_); + std::stringstream ss; + auto now = std::chrono::steady_clock::now(); + ss << absl::Substitute("File Source Manager Debug State:\n"); + ss << absl::Substitute("ID\tNAME\tCURRENT_STATE\tEXPECTED_STATE\tlast_updated\n"); + for (const auto& [id, file_source] : file_sources_) { + ss << absl::Substitute( + "$0\t$1\t$2\t$3\t$4 seconds\n", id.str(), file_source.name, + statuspb::LifeCycleState_Name(file_source.current_state), + statuspb::LifeCycleState_Name(file_source.expected_state), + std::chrono::duration_cast(now - file_source.last_updated_at) + .count()); + } + return ss.str(); +} + +Status FileSourceManager::HandleRegisterFileSourceRequest(sole::uuid id, std::string file_name) { + LOG(INFO) << "Registering file source: " << file_name; + + FileSourceInfo info; + info.name = file_name; + info.id = id; + info.expected_state = statuspb::RUNNING_STATE; + info.current_state = statuspb::PENDING_STATE; + info.last_updated_at = dispatcher_->GetTimeSource().MonotonicTime(); + stirling_->RegisterFileSource(id, file_name); + { + std::lock_guard lock(mu_); + file_sources_[id] = std::move(info); + file_source_name_map_[file_name] = id; + } + return Status::OK(); +} + +Status FileSourceManager::HandleRemoveFileSourceRequest( + sole::uuid id, const messages::FileSourceMessage& /*msg*/) { + std::lock_guard lock(mu_); + auto it = file_sources_.find(id); + if (it == file_sources_.end()) { + return error::NotFound("File source with ID: $0, not found", id.str()); + } + + it->second.expected_state = statuspb::TERMINATED_STATE; + return stirling_->RemoveFileSource(id); +} + +void FileSourceManager::Monitor() { + std::lock_guard lock(mu_); + + for (auto& [id, file_source] : file_sources_) { + auto s_or_publish = stirling_->GetFileSourceInfo(id); + statuspb::LifeCycleState current_state; + // Get the latest current state according to stirling. + if (s_or_publish.ok()) { + current_state = statuspb::RUNNING_STATE; + } else { + switch (s_or_publish.code()) { + case statuspb::FAILED_PRECONDITION: + // Means the binary has not been found. + current_state = statuspb::FAILED_STATE; + break; + case statuspb::RESOURCE_UNAVAILABLE: + current_state = statuspb::PENDING_STATE; + break; + case statuspb::NOT_FOUND: + // Means we didn't actually find the probe. If we requested termination, + // it's because the probe has been removed. + current_state = (file_source.expected_state == statuspb::TERMINATED_STATE) + ? statuspb::TERMINATED_STATE + : statuspb::UNKNOWN_STATE; + break; + default: + current_state = statuspb::FAILED_STATE; + break; + } + } + + if (current_state != statuspb::RUNNING_STATE && + file_source.expected_state == statuspb::TERMINATED_STATE) { + current_state = statuspb::TERMINATED_STATE; + } + + if (current_state == file_source.current_state) { + // No state transition, nothing to do. + continue; + } + + // The following transitions are legal: + // 1. Pending -> Terminated: Probe is stopped before starting. + // 2. Pending -> Running : Probe starts up. + // 3. Running -> Terminated: Probe is stopped. + // 4. Running -> Failed: Probe got dettached because binary died. + // 5. Failed -> Running: Probe started up because binary came back to life. + // + // In all cases we basically inform the MDS. + // In the cases where we transition to running, we need to update the schemas. + + Status probe_status = Status::OK(); + LOG(INFO) << absl::Substitute("File source[$0]::$1 has transitioned $2 -> $3", id.str(), + file_source.name, + statuspb::LifeCycleState_Name(file_source.current_state), + statuspb::LifeCycleState_Name(current_state)); + // Check if running now, then update the schema. + if (current_state == statuspb::RUNNING_STATE) { + // We must have just transitioned into running. We try to apply the new schema. + // If it fails we will trigger an error and report that to MDS. + auto publish_pb = s_or_publish.ConsumeValueOrDie(); + auto s = UpdateSchema(publish_pb); + if (!s.ok()) { + current_state = statuspb::FAILED_STATE; + probe_status = s; + } + } else { + probe_status = s_or_publish.status(); + } + + file_source.current_state = current_state; + } + file_source_monitor_timer_->EnableTimer(kUpdateInterval); +} + +Status FileSourceManager::UpdateSchema(const stirling::stirlingpb::Publish& publish_pb) { + LOG(INFO) << "Updating schema for file source"; + auto relation_info_vec = ConvertPublishPBToRelationInfo(publish_pb); + + // TODO(ddelnano): Failure here can lead to an inconsistent schema state. We should + // figure out how to handle this as part of the data model refactor project. + for (const auto& relation_info : relation_info_vec) { + LOG(INFO) << absl::Substitute("Adding table: $0", relation_info.name); + table_store_->AddTable( + table_store::HotOnlyTable::Create(relation_info.name, relation_info.relation), + relation_info.name, relation_info.id); + } + return Status::OK(); +} + +FileSourceInfo* FileSourceManager::GetFileSourceInfo(std::string name) { + std::lock_guard lock(mu_); + auto pair = file_source_name_map_.find(name); + if (pair == file_source_name_map_.end()) { + return nullptr; + } + + auto id_pair = file_sources_.find(pair->second); + if (id_pair == file_sources_.end()) { + return nullptr; + } + + return &id_pair->second; +} + +} // namespace agent +} // namespace vizier +} // namespace px diff --git a/src/experimental/standalone_pem/file_source_manager.h b/src/experimental/standalone_pem/file_source_manager.h new file mode 100644 index 00000000000..7e426bc69be --- /dev/null +++ b/src/experimental/standalone_pem/file_source_manager.h @@ -0,0 +1,71 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include + +#include + +#include "src/stirling/stirling.h" +#include "src/vizier/services/agent/shared/manager/manager.h" + +namespace px { +namespace vizier { +namespace agent { + +struct FileSourceInfo { + std::string name; + sole::uuid id; + statuspb::LifeCycleState expected_state; + statuspb::LifeCycleState current_state; + std::chrono::time_point last_updated_at; +}; + +class FileSourceManager { + public: + FileSourceManager() = delete; + FileSourceManager(px::event::Dispatcher* dispatcher, stirling::Stirling* stirling, + table_store::TableStore* table_store); + + std::string DebugString() const; + Status HandleRegisterFileSourceRequest(sole::uuid id, std::string file_name); + Status HandleRemoveFileSourceRequest(sole::uuid id, const messages::FileSourceMessage& req); + FileSourceInfo* GetFileSourceInfo(std::string name); + + private: + // The tracepoint Monitor that is responsible for watching and updating the state of + // active tracepoints. + void Monitor(); + Status UpdateSchema(const stirling::stirlingpb::Publish& publish_proto); + + px::event::Dispatcher* dispatcher_; + stirling::Stirling* stirling_; + table_store::TableStore* table_store_; + + event::TimerUPtr file_source_monitor_timer_; + mutable std::mutex mu_; + absl::flat_hash_map file_sources_; + // File source name to UUID. + absl::flat_hash_map file_source_name_map_; +}; + +} // namespace agent +} // namespace vizier +} // namespace px diff --git a/src/experimental/standalone_pem/standalone_pem_manager.cc b/src/experimental/standalone_pem/standalone_pem_manager.cc index d1257dbdbfd..312b189d327 100644 --- a/src/experimental/standalone_pem/standalone_pem_manager.cc +++ b/src/experimental/standalone_pem/standalone_pem_manager.cc @@ -73,6 +73,7 @@ StandalonePEMManager::StandalonePEMManager(sole::uuid agent_id, std::string_view dispatcher_(api_->AllocateDispatcher("manager")), table_store_(std::make_shared()), func_context_(this, /* mds_stub= */ nullptr, /* mdtp_stub= */ nullptr, + /* mdfs_stub= */ nullptr, /* cronscript_stub= */ nullptr, table_store_, [](grpc::ClientContext*) {}), stirling_(px::stirling::Stirling::Create(px::stirling::CreateSourceRegistryFromFlag())), results_sink_server_(std::make_unique()) { @@ -102,11 +103,16 @@ StandalonePEMManager::StandalonePEMManager(sole::uuid agent_id, std::string_view std::move(clients_config), std::move(server_config)) .ConsumeValueOrDie(); + const std::string proc_pid_path = std::string("/proc/") + std::to_string(info_.pid); + PX_ASSIGN_OR_RETURN(auto start_time, system::GetPIDStartTimeTicks(proc_pid_path)); + mds_manager_ = std::make_unique( - info_.hostname, info_.asid, info_.pid, info_.agent_id, time_system_.get()); + info_.hostname, info_.asid, info_.pid, start_time, info_.agent_id, time_system_.get()); tracepoint_manager_ = std::make_unique(dispatcher_.get(), stirling_.get(), table_store_.get()); + file_source_manager_ = + std::make_unique(dispatcher_.get(), stirling_.get(), table_store_.get()); // Force Metadata Update. ECHECK_OK(mds_manager_->PerformMetadataStateUpdate()); } @@ -146,9 +152,9 @@ Status StandalonePEMManager::Init() { stirling_->RegisterAgentMetadataCallback( std::bind(&px::md::AgentMetadataStateManager::CurrentAgentMetadataState, mds_manager_.get())); - vizier_grpc_server_ = - std::make_unique(port_, carnot_.get(), results_sink_server_.get(), - carnot_->GetEngineState(), tracepoint_manager_.get()); + vizier_grpc_server_ = std::make_unique( + port_, carnot_.get(), results_sink_server_.get(), carnot_->GetEngineState(), + tracepoint_manager_.get(), file_source_manager_.get()); return Status::OK(); } @@ -211,20 +217,20 @@ Status StandalonePEMManager::InitSchemas() { // Special case to set the max size of the http_events table differently from the other // tables. For now, the min cold batch size is set to 256kB to be consistent with previous // behaviour. - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - http_table_size, 256 * 1024); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, http_table_size, 256 * 1024); } else if (relation_info.name == "stirling_error") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - stirling_error_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, stirling_error_table_size); } else if (relation_info.name == "probe_status") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - probe_status_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, probe_status_table_size); } else if (relation_info.name == "proc_exit_events") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - proc_exit_events_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, proc_exit_events_table_size); } else { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - other_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, other_table_size); } table_store_->AddTable(std::move(table_ptr), relation_info.name, relation_info.id); diff --git a/src/experimental/standalone_pem/standalone_pem_manager.h b/src/experimental/standalone_pem/standalone_pem_manager.h index 9d658b1306a..99af95bddbc 100644 --- a/src/experimental/standalone_pem/standalone_pem_manager.h +++ b/src/experimental/standalone_pem/standalone_pem_manager.h @@ -23,6 +23,7 @@ #include "src/carnot/carnot.h" #include "src/common/event/event.h" +#include "src/experimental/standalone_pem/file_source_manager.h" #include "src/experimental/standalone_pem/sink_server.h" #include "src/experimental/standalone_pem/tracepoint_manager.h" #include "src/experimental/standalone_pem/vizier_server.h" @@ -87,6 +88,9 @@ class StandalonePEMManager : public BaseManager { // Tracepoints std::unique_ptr tracepoint_manager_; + + // FileSource manager + std::unique_ptr file_source_manager_; }; } // namespace agent diff --git a/src/experimental/standalone_pem/tracepoint_manager.cc b/src/experimental/standalone_pem/tracepoint_manager.cc index f05772f0a04..240050d74b9 100644 --- a/src/experimental/standalone_pem/tracepoint_manager.cc +++ b/src/experimental/standalone_pem/tracepoint_manager.cc @@ -178,8 +178,9 @@ Status TracepointManager::UpdateSchema(const stirling::stirlingpb::Publish& publ // TODO(zasgar): Failure here can lead to an inconsistent schema state. We should // // figure out how to handle this as part of the data model refactor project. for (const auto& relation_info : relation_info_vec) { - table_store_->AddTable(table_store::Table::Create(relation_info.name, relation_info.relation), - relation_info.name, relation_info.id); + table_store_->AddTable( + table_store::HotColdTable::Create(relation_info.name, relation_info.relation), + relation_info.name, relation_info.id); } return Status::OK(); } diff --git a/src/experimental/standalone_pem/vizier_server.h b/src/experimental/standalone_pem/vizier_server.h index ce071bf379c..1968e0fe96d 100644 --- a/src/experimental/standalone_pem/vizier_server.h +++ b/src/experimental/standalone_pem/vizier_server.h @@ -50,11 +50,13 @@ class VizierServer final : public api::vizierpb::VizierService::Service { public: VizierServer() = delete; VizierServer(carnot::Carnot* carnot, px::vizier::agent::StandaloneGRPCResultSinkServer* svr, - px::carnot::EngineState* engine_state, TracepointManager* tp_manager) { + px::carnot::EngineState* engine_state, TracepointManager* tp_manager, + FileSourceManager* file_source_manager) { carnot_ = carnot; sink_server_ = svr; engine_state_ = engine_state; tp_manager_ = tp_manager; + file_source_manager_ = file_source_manager; } ::grpc::Status ExecuteScript( @@ -63,6 +65,7 @@ class VizierServer final : public api::vizierpb::VizierService::Service { LOG(INFO) << "Executing Script"; auto query_id = sole::uuid4(); + auto compiler_state = engine_state_->CreateLocalExecutionCompilerState(0); // Handle mutations. @@ -79,8 +82,10 @@ class VizierServer final : public api::vizierpb::VizierService::Service { auto mutations = mutations_or_s.ConsumeValueOrDie(); auto deployments = mutations->Deployments(); + auto file_source_deployments = mutations->FileSourceDeployments(); bool tracepoints_running = true; + auto ntp_info = TracepointInfo{}; for (size_t i = 0; i < deployments.size(); i++) { carnot::planner::dynamic_tracing::ir::logical::TracepointDeployment planner_tp; auto s = deployments[i]->ToProto(&planner_tp); @@ -99,7 +104,6 @@ class VizierServer final : public api::vizierpb::VizierService::Service { if (!s.ok()) { return ::grpc::Status(grpc::StatusCode::INTERNAL, "Failed to register tracepoint"); } - auto ntp_info = TracepointInfo{}; ntp_info.name = stirling_tp.name(); ntp_info.id = tp_id; ntp_info.current_state = statuspb::PENDING_STATE; @@ -117,9 +121,34 @@ class VizierServer final : public api::vizierpb::VizierService::Service { return ::grpc::Status::CANCELLED; } - auto m_info = mutation_resp.mutable_mutation_info(); - m_info->mutable_status()->set_code(0); - response->Write(mutation_resp); + auto file_sources_running = true; + auto nfile_source_info = FileSourceInfo{}; + for (size_t i = 0; i < file_source_deployments.size(); i++) { + auto file_source = file_source_deployments[i]; + auto file_source_info = file_source_manager_->GetFileSourceInfo(file_source.glob_pattern()); + if (file_source_info == nullptr) { + auto s = file_source_manager_->HandleRegisterFileSourceRequest( + sole::uuid4(), file_source.glob_pattern()); + if (!s.ok()) { + return ::grpc::Status(grpc::StatusCode::INTERNAL, "Failed to register file source"); + } + nfile_source_info.name = file_source.glob_pattern(); + nfile_source_info.current_state = statuspb::PENDING_STATE; + file_source_info = &nfile_source_info; + } + if (file_source_info->current_state != statuspb::RUNNING_STATE) { + file_sources_running = false; + } + } + if (!file_sources_running) { + auto m_info = mutation_resp.mutable_mutation_info(); + m_info->mutable_status()->set_code(grpc::StatusCode::UNAVAILABLE); + response->Write(mutation_resp); + return ::grpc::Status::CANCELLED; + } + /* auto m_info = mutation_resp.mutable_mutation_info(); */ + /* m_info->mutable_status()->set_code(0); */ + /* response->Write(mutation_resp); */ } LOG(INFO) << "Compiling and running query"; // Send schema before sending query results. @@ -201,6 +230,7 @@ class VizierServer final : public api::vizierpb::VizierService::Service { px::vizier::agent::StandaloneGRPCResultSinkServer* sink_server_; px::carnot::EngineState* engine_state_; TracepointManager* tp_manager_; + FileSourceManager* file_source_manager_; }; class VizierGRPCServer { @@ -208,8 +238,10 @@ class VizierGRPCServer { VizierGRPCServer() = delete; VizierGRPCServer(int port, carnot::Carnot* carnot, px::vizier::agent::StandaloneGRPCResultSinkServer* svr, - carnot::EngineState* engine_state, TracepointManager* tp_manager) - : vizier_server_(std::make_unique(carnot, svr, engine_state, tp_manager)) { + carnot::EngineState* engine_state, TracepointManager* tp_manager, + FileSourceManager* file_source_manager) + : vizier_server_(std::make_unique(carnot, svr, engine_state, tp_manager, + file_source_manager)) { grpc::ServerBuilder builder; std::string uri = absl::Substitute("0.0.0.0:$0", port); diff --git a/src/pxl_scripts/px/pipeline_flow_graph/manifest.yaml b/src/pxl_scripts/px/pipeline_flow_graph/manifest.yaml new file mode 100644 index 00000000000..178d1cc9659 --- /dev/null +++ b/src/pxl_scripts/px/pipeline_flow_graph/manifest.yaml @@ -0,0 +1,4 @@ +--- +short: Overview of Pipeline throughput +long: > + This view displays a summary of the throughput of the pipeline. diff --git a/src/pxl_scripts/px/pipeline_flow_graph/pipeline_flow_graph.pxl b/src/pxl_scripts/px/pipeline_flow_graph/pipeline_flow_graph.pxl new file mode 100644 index 00000000000..f8dc4466a4b --- /dev/null +++ b/src/pxl_scripts/px/pipeline_flow_graph/pipeline_flow_graph.pxl @@ -0,0 +1,82 @@ +import px + +kelvin_dest = "unknown" +bpf_source_op_start = 10000 +memory_source_op = 1000 # This corresponds to a file source +file_source_op = 2 +# TODO(ddelnano): This currently can't tell the difference +# between an internal and external grpc sink. +grpc_sink_op = 9100 +otel_export_op = 9200 + +def final_dest_to_str(dest): + return px.select(dest == otel_export_op, "Otel Export", kelvin_dest) + +def get_memory_source_sink_results(df, min_asid): + file_sources = px.GetFileSourceStatus() + file_sources.stream_id = file_sources.file_source_id + + tracepoint_sources = px.GetTracepointStatus() + tracepoint_sources.stream_id = tracepoint_sources.tracepoint_id_str + + df = df[df.destination > bpf_source_op_start or df.destination == memory_source_op] + file_sources_df = df.merge(file_sources, how='left', left_on='stream_id', right_on='file_source_id') + file_sources_df = file_sources_df['time_', 'upid', 'pod', 'name', 'bytes_transferred', 'destination', 'stream_id_x', 'stream_id_y', 'match'] + tracepoint_sources_df = df.merge(tracepoint_sources, how='left', left_on='stream_id', right_on='tracepoint_id_str') + tracepoint_sources_df = tracepoint_sources_df['time_', 'upid', 'pod', 'name', 'bytes_transferred', 'destination', 'stream_id_x', 'stream_id_y', 'match'] + + df = file_sources_df.append(tracepoint_sources_df) + + # stream_id_y is the column from the file_sources UDTF after the merge + df.is_bpf_source = df.stream_id_y == "" + df = df.merge(min_asid, how='left', left_on='match', right_on='match') + + df.to_entity = df.pod + df.from_entity = px.select(df.is_bpf_source, px.pipeline_dest_to_name(df.destination), df.name) + " " + px.itoa(px.upid_to_asid(df.upid) - df.min_asid) + df = df['time_', 'from_entity', 'to_entity', 'bytes_transferred'] + df = df.groupby(['from_entity', 'to_entity']).agg( + total_bytes=('bytes_transferred', px.sum), + ) + + return df + +def pipeline_flow_graph(start_time: str): + agents = px.GetAgentStatus() + kelvin = agents[px.contains(agents.hostname, "kelvin")] + min_asid = agents.agg(min_asid=('asid', px.min)) + min_asid.match = True + + df = px.DataFrame('sink_results', start_time=start_time) + df.pod = df.ctx['pod'] + df.match = True + + mem_source_sink_results = get_memory_source_sink_results(df, min_asid) + + df = df[df.destination == otel_export_op or df.destination == grpc_sink_op] + df.final_dest = final_dest_to_str(df.destination) + + # Use a dummy column that matches in both data frames + # so the Kelvin hostname join works as expected + kelvin.match = True + + # For external GRPC sinks, df.pod will be empty and kelvin_dest will be "unknown" + df.is_dest_kelvin = px.select(df.final_dest == kelvin_dest and df.pod != "", True, False) + df.final_dest = px.select(not df.is_dest_kelvin and df.final_dest == kelvin_dest, "px.display", df.final_dest) + df = df.merge(kelvin, how='left', left_on='match', right_on='match') + # Remove the port from the ip_address column from the GetAgentStatus UDTF + df.ip_address = px.pluck_array(px.split(df.ip_address, ":"), 0) + df.kelvin_pod = px.pod_id_to_pod_name(px.ip_to_pod_id(df.ip_address)) + + df.from_entity = px.select(df.is_dest_kelvin, df.pod, df.kelvin_pod) + df.to_entity = px.select(df.is_dest_kelvin, df.kelvin_pod, df.final_dest) + + df = df.groupby(['from_entity', 'to_entity']).agg( + total_bytes=('bytes_transferred', px.sum), + ) + + df = df.append(mem_source_sink_results) + df = df[px.substring(df.from_entity, 0, 7) != "unknown"] + df.total_time = px.abs(px.parse_duration(start_time)) / px.pow(10, 9) + df.bytes_throughput = df.total_bytes / df.total_time + return df + diff --git a/src/pxl_scripts/px/pipeline_flow_graph/vis.json b/src/pxl_scripts/px/pipeline_flow_graph/vis.json new file mode 100644 index 00000000000..aba41d05c23 --- /dev/null +++ b/src/pxl_scripts/px/pipeline_flow_graph/vis.json @@ -0,0 +1,49 @@ +{ + "variables": [ + { + "name": "start_time", + "type": "PX_STRING", + "description": "The start time of the window in time units before now.", + "defaultValue": "-5m" + } + ], + "globalFuncs": [ + { + "outputName": "pipeline_flow", + "func": { + "name": "pipeline_flow_graph", + "args": [ + { + "name": "start_time", + "variable": "start_time" + } + ] + } + } + ], + "widgets": [ + { + "name": "Pipeline Flow Graph", + "position": { + "x": 0, + "y": 0, + "w": 12, + "h": 4 + }, + "globalFuncOutputName": "pipeline_flow", + "displaySpec": { + "@type": "types.px.dev/px.vispb.Graph", + "adjacencyList": { + "fromColumn": "from_entity", + "toColumn": "to_entity" + }, + "edgeWeightColumn": "bytes_throughput", + "edgeHoverInfo": [ + "bytes_throughput" + ], + "enableDefaultHierarchy": true, + "edgeLength": 500 + } + } + ] +} diff --git a/src/shared/metadata/metadata_state.cc b/src/shared/metadata/metadata_state.cc index 098d95179c5..e09f7fa7301 100644 --- a/src/shared/metadata/metadata_state.cc +++ b/src/shared/metadata/metadata_state.cc @@ -569,7 +569,7 @@ Status K8sMetadataState::CleanupExpiredMetadata(int64_t now, int64_t retention_t std::shared_ptr AgentMetadataState::CloneToShared() const { auto state = - std::make_shared(hostname_, asid_, pid_, agent_id_, pod_name_, vizier_id_, + std::make_shared(hostname_, asid_, pid_, start_time_, agent_id_, pod_name_, vizier_id_, vizier_name_, vizier_namespace_, time_system_); state->last_update_ts_ns_ = last_update_ts_ns_; state->epoch_id_ = epoch_id_; diff --git a/src/shared/metadata/metadata_state.h b/src/shared/metadata/metadata_state.h index e2fdc9e6c86..95957de23dc 100644 --- a/src/shared/metadata/metadata_state.h +++ b/src/shared/metadata/metadata_state.h @@ -341,13 +341,14 @@ class K8sMetadataState : NotCopyable { class AgentMetadataState : NotCopyable { public: AgentMetadataState() = delete; - AgentMetadataState(std::string_view hostname, uint32_t asid, uint32_t pid, AgentID agent_id, + AgentMetadataState(std::string_view hostname, uint32_t asid, uint32_t pid, uint64_t start_time, AgentID agent_id, std::string_view pod_name, sole::uuid vizier_id, std::string_view vizier_name, std::string_view vizier_namespace, event::TimeSystem* time_system) : hostname_(std::string(hostname)), pod_name_(std::string(pod_name)), asid_(asid), pid_(pid), + start_time_(start_time), agent_id_(agent_id), vizier_id_(vizier_id), vizier_name_(std::string(vizier_name)), @@ -360,6 +361,7 @@ class AgentMetadataState : NotCopyable { uint32_t pid() const { return pid_; } const std::string& pod_name() const { return pod_name_; } const sole::uuid& agent_id() const { return agent_id_; } + const md::UPID agent_upid() const { return md::UPID(asid_, pid_, start_time_); } const sole::uuid& vizier_id() const { return vizier_id_; } const std::string& vizier_name() const { return vizier_name_; } @@ -433,6 +435,7 @@ class AgentMetadataState : NotCopyable { std::string pod_name_; uint32_t asid_; uint32_t pid_; + uint64_t start_time_; AgentID agent_id_; sole::uuid vizier_id_; diff --git a/src/shared/metadata/standalone_state_manager.h b/src/shared/metadata/standalone_state_manager.h index 82cb16030ed..a353f470682 100644 --- a/src/shared/metadata/standalone_state_manager.h +++ b/src/shared/metadata/standalone_state_manager.h @@ -35,9 +35,9 @@ namespace md { */ class StandaloneAgentMetadataStateManager : public AgentMetadataStateManager { public: - StandaloneAgentMetadataStateManager(std::string_view hostname, uint32_t asid, uint32_t pid, + StandaloneAgentMetadataStateManager(std::string_view hostname, uint32_t asid, uint32_t pid, uint64_t start_time, sole::uuid agent_id, event::TimeSystem* time_system) { - agent_metadata_state_ = std::make_shared(hostname, asid, pid, agent_id, + agent_metadata_state_ = std::make_shared(hostname, asid, pid, start_time, agent_id, /*pod_name=*/"", sole::uuid(), "standalone_pem", "", time_system); } diff --git a/src/shared/metadata/state_manager.h b/src/shared/metadata/state_manager.h index 67dec26b962..68f73f5fa37 100644 --- a/src/shared/metadata/state_manager.h +++ b/src/shared/metadata/state_manager.h @@ -119,7 +119,7 @@ class AgentMetadataStateManagerImpl : public AgentMetadataStateManager { public: virtual ~AgentMetadataStateManagerImpl() = default; - AgentMetadataStateManagerImpl(std::string_view hostname, uint32_t asid, uint32_t pid, + AgentMetadataStateManagerImpl(std::string_view hostname, uint32_t asid, uint32_t pid, uint64_t start_time, std::string pod_name, sole::uuid agent_id, bool collects_data, const px::system::Config& config, AgentMetadataFilter* metadata_filter, sole::uuid vizier_id, @@ -128,7 +128,7 @@ class AgentMetadataStateManagerImpl : public AgentMetadataStateManager { : pod_name_(pod_name), collects_data_(collects_data), metadata_filter_(metadata_filter) { md_reader_ = std::make_unique(config); agent_metadata_state_ = - std::make_shared(hostname, asid, pid, agent_id, pod_name, vizier_id, + std::make_shared(hostname, asid, pid, start_time, agent_id, pod_name, vizier_id, vizier_name, vizier_namespace, time_system); } diff --git a/src/shared/schema/utils.cc b/src/shared/schema/utils.cc index c17e5fbffb3..fde9bc093b2 100644 --- a/src/shared/schema/utils.cc +++ b/src/shared/schema/utils.cc @@ -35,13 +35,19 @@ table_store::schema::Relation InfoClassProtoToRelation( RelationInfo ConvertInfoClassPBToRelationInfo( const stirling::stirlingpb::InfoClass& info_class_pb) { + auto schema = info_class_pb.schema(); + std::optional mutation_id; + if (schema.mutation_id() != "") { + mutation_id = schema.mutation_id(); + } if (info_class_pb.schema().tabletized()) { - return RelationInfo(info_class_pb.schema().name(), info_class_pb.id(), - info_class_pb.schema().desc(), info_class_pb.schema().tabletization_key(), + return RelationInfo(schema.name(), info_class_pb.id(), schema.desc(), + schema.tabletization_key(), mutation_id, InfoClassProtoToRelation(info_class_pb)); } return RelationInfo(info_class_pb.schema().name(), info_class_pb.id(), - info_class_pb.schema().desc(), InfoClassProtoToRelation(info_class_pb)); + info_class_pb.schema().desc(), mutation_id, + InfoClassProtoToRelation(info_class_pb)); } } // namespace diff --git a/src/shared/schema/utils.h b/src/shared/schema/utils.h index 991edda5340..0b586f8d34c 100644 --- a/src/shared/schema/utils.h +++ b/src/shared/schema/utils.h @@ -32,20 +32,22 @@ namespace px { struct RelationInfo { RelationInfo() = default; RelationInfo(std::string name, uint64_t id, std::string desc, - table_store::schema::Relation relation) + std::optional mutation_id, table_store::schema::Relation relation) : name(std::move(name)), id(id), desc(std::move(desc)), tabletized(false), + mutation_id(mutation_id), relation(std::move(relation)) {} RelationInfo(std::string name, uint64_t id, std::string desc, uint64_t tabletization_key_idx, - table_store::schema::Relation relation) + std::optional mutation_id, table_store::schema::Relation relation) : name(std::move(name)), id(id), desc(std::move(desc)), tabletized(true), tabletization_key_idx(tabletization_key_idx), + mutation_id(mutation_id), relation(std::move(relation)) {} std::string name; @@ -53,6 +55,7 @@ struct RelationInfo { std::string desc; bool tabletized; uint64_t tabletization_key_idx; + std::optional mutation_id; table_store::schema::Relation relation; }; diff --git a/src/stirling/BUILD.bazel b/src/stirling/BUILD.bazel index 12b399e3218..ec3e9a759e4 100644 --- a/src/stirling/BUILD.bazel +++ b/src/stirling/BUILD.bazel @@ -49,6 +49,7 @@ pl_cc_library( "//src/stirling/proto:stirling_pl_cc_proto", "//src/stirling/source_connectors/dynamic_bpftrace:cc_library", "//src/stirling/source_connectors/dynamic_tracer:cc_library", + "//src/stirling/source_connectors/file_source:cc_library", "//src/stirling/source_connectors/jvm_stats:cc_library", "//src/stirling/source_connectors/network_stats:cc_library", "//src/stirling/source_connectors/perf_profiler:cc_library", diff --git a/src/stirling/core/BUILD.bazel b/src/stirling/core/BUILD.bazel index ab795229aad..587f46b427c 100644 --- a/src/stirling/core/BUILD.bazel +++ b/src/stirling/core/BUILD.bazel @@ -32,6 +32,7 @@ pl_cc_library( "//src/stirling/source_connectors/cpu_stat_bpftrace:__pkg__", "//src/stirling/source_connectors/dynamic_bpftrace:__pkg__", "//src/stirling/source_connectors/dynamic_tracer:__pkg__", + "//src/stirling/source_connectors/file_source:__pkg__", "//src/stirling/source_connectors/jvm_stats:__pkg__", "//src/stirling/source_connectors/network_stats:__pkg__", "//src/stirling/source_connectors/perf_profiler:__pkg__", diff --git a/src/stirling/core/info_class_manager.cc b/src/stirling/core/info_class_manager.cc index 82483a8e180..19cb1fa91f7 100644 --- a/src/stirling/core/info_class_manager.cc +++ b/src/stirling/core/info_class_manager.cc @@ -32,8 +32,12 @@ void InfoClassManager::InitContext(ConnectorContext* ctx) { source_->InitContext stirlingpb::InfoClass InfoClassManager::ToProto() const { stirlingpb::InfoClass info_class_proto; - info_class_proto.mutable_schema()->CopyFrom(schema_.ToProto()); + auto schema = info_class_proto.mutable_schema(); + schema->CopyFrom(schema_.ToProto()); info_class_proto.set_id(id()); + if (mutation_id_.has_value()) { + schema->set_mutation_id(mutation_id_.value()); + } return info_class_proto; } diff --git a/src/stirling/core/info_class_manager.h b/src/stirling/core/info_class_manager.h index dc929a871d7..98a5cf05f9f 100644 --- a/src/stirling/core/info_class_manager.h +++ b/src/stirling/core/info_class_manager.h @@ -73,6 +73,13 @@ class InfoClassManager final : public NotCopyable { */ void SetSourceConnector(SourceConnector* source) { source_ = source; } + /** + * @brief Mutation ID connector connected to this Info Class if one exists + * + * @param source Pointer to source connector instance. + */ + void SetMutationId(std::optional mutation_id) { mutation_id_ = mutation_id; } + /** * Get the schema of the InfoClass. * @@ -128,6 +135,9 @@ class InfoClassManager final : public NotCopyable { // Pointer to the data table where the data is stored. std::unique_ptr data_table_; + + // The mutation ID of the info class manager if one exists. + std::optional mutation_id_; }; using InfoClassManagerVec = std::vector>; diff --git a/src/stirling/core/info_class_manager_test.cc b/src/stirling/core/info_class_manager_test.cc index c67f78e24fe..f8440c9b856 100644 --- a/src/stirling/core/info_class_manager_test.cc +++ b/src/stirling/core/info_class_manager_test.cc @@ -27,6 +27,7 @@ namespace stirling { using types::DataType; using types::PatternType; +// TODO(ddelnano): Add test regarding ToProto and SetMutationId. TEST(InfoClassInfoSchemaTest, infoclass_mgr_proto_getters_test) { InfoClassManager info_class_mgr(SeqGenConnector::kSeq0Table); auto source = SeqGenConnector::Create("sequences"); diff --git a/src/stirling/core/source_connector.cc b/src/stirling/core/source_connector.cc index a9566daea49..ae2373c8fbb 100644 --- a/src/stirling/core/source_connector.cc +++ b/src/stirling/core/source_connector.cc @@ -61,7 +61,7 @@ void SourceConnector::PushData(DataPushCallback agent_callback) { Status s = agent_callback( data_table->id(), record_batch.tablet_id, std::make_unique(std::move(record_batch.records))); - LOG_IF(DFATAL, !s.ok()) << absl::Substitute("Failed to push data. Message = $0", s.msg()); + LOG_IF(ERROR, !s.ok()) << absl::Substitute("Failed to push data. Message = $0", s.msg()); } } } diff --git a/src/stirling/proto/stirling.proto b/src/stirling/proto/stirling.proto index ab36ce6297c..e0d1b374c23 100644 --- a/src/stirling/proto/stirling.proto +++ b/src/stirling/proto/stirling.proto @@ -48,6 +48,7 @@ message TableSchema { repeated Element elements = 2; bool tabletized = 3; uint64 tabletization_key = 4; + string mutation_id = 6; } // InfoClass stores a set of Elements that share common timestamps (i.e., they are diff --git a/src/stirling/source_connectors/file_source/BUILD.bazel b/src/stirling/source_connectors/file_source/BUILD.bazel new file mode 100644 index 00000000000..11dbfdc1630 --- /dev/null +++ b/src/stirling/source_connectors/file_source/BUILD.bazel @@ -0,0 +1,60 @@ +# Copyright 2018- The Pixie Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +load("//bazel:pl_build_system.bzl", "pl_cc_bpf_test", "pl_cc_library", "pl_cc_test") + +package(default_visibility = ["//src/stirling:__subpackages__"]) + +pl_cc_library( + name = "cc_library", + srcs = glob( + ["*.cc"], + exclude = [ + "**/*_test.cc", + ], + ), + hdrs = glob(["*.h"]), + deps = [ + "//src/stirling/core:cc_library", + "//src/stirling/utils:cc_library", + "@com_github_tencent_rapidjson//:rapidjson", + ], +) + +pl_cc_test( + name = "file_source_connector_test", + srcs = ["file_source_connector_test.cc"], + data = [ + "testdata/test.json", + "testdata/unsupported.json", + ], + deps = [ + ":cc_library", + ], +) + +pl_cc_test( + name = "stirling_fs_test", + srcs = ["stirling_fs_test.cc"], + data = [ + "testdata/test.json", + "testdata/unsupported.json", + ], + deps = [ + ":cc_library", + "//src/stirling:cc_library", + ], +) diff --git a/src/stirling/source_connectors/file_source/file_source_connector.cc b/src/stirling/source_connectors/file_source/file_source_connector.cc new file mode 100644 index 00000000000..112c472ce05 --- /dev/null +++ b/src/stirling/source_connectors/file_source/file_source_connector.cc @@ -0,0 +1,287 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "src/stirling/source_connectors/file_source/file_source_connector.h" + +#include +#include + +#include +#include + +using px::StatusOr; + +constexpr size_t kMaxStringBytes = std::numeric_limits::max(); + +namespace px { +namespace stirling { + +using px::utils::RapidJSONTypeToString; + +StatusOr DataElementsFromJSON(std::ifstream& f_stream) { + std::string line; + std::getline(f_stream, line); + + if (f_stream.eof()) { + return error::Internal("Failed to read file, hit EOF"); + } + + rapidjson::Document d; + rapidjson::ParseResult ok = d.Parse(line.c_str()); + if (!ok) { + return error::Internal("Failed to parse JSON: $0 $1", line, + rapidjson::GetParseError_En(ok.Code())); + } + auto elements = d.MemberCount() + 2; // Add additional columns for time_ + BackedDataElements data_elements(elements); + + data_elements.emplace_back("time_", "", types::DataType::TIME64NS); + // TODO(ddelnano): Make it configurable to request a UUID in PxL rather than creating it by default. + data_elements.emplace_back("uuid", "", types::DataType::UINT128); + for (rapidjson::Value::ConstMemberIterator itr = d.MemberBegin(); itr != d.MemberEnd(); ++itr) { + auto name = itr->name.GetString(); + const auto& value = itr->value; + types::DataType col_type; + + if (value.IsInt()) { + col_type = types::DataType::INT64; + } else if (value.IsDouble()) { + col_type = types::DataType::FLOAT64; + } else if (value.IsString()) { + col_type = types::DataType::STRING; + } else if (value.IsBool()) { + col_type = types::DataType::BOOLEAN; + } else if (value.IsObject()) { + col_type = types::DataType::STRING; + } else if (value.IsArray()) { + col_type = types::DataType::STRING; + } else { + return error::Internal("Unable to parse JSON key '$0': unsupported type: $1", name, + RapidJSONTypeToString(itr->value.GetType())); + } + data_elements.emplace_back(name, "", col_type); + } + + return data_elements; +} + +StatusOr DataElementsFromCSV(std::ifstream& file_name) { + PX_UNUSED(file_name); + return BackedDataElements(0); +} + +StatusOr DataElementsForUnstructuredFile() { + BackedDataElements data_elements(3); + data_elements.emplace_back("time_", "", types::DataType::TIME64NS); + data_elements.emplace_back("uuid", "", types::DataType::UINT128); + data_elements.emplace_back("raw_line", "", types::DataType::STRING); + return data_elements; +} + +namespace { + +StatusOr> DataElementsFromFile( + const std::filesystem::path& file_name, bool allow_unstructured = true) { + auto f = std::ifstream(file_name.string()); + if (!f.is_open()) { + return error::Internal("Failed to open file: $0 with error=$1", file_name.string(), + strerror(errno)); + } + + // get the file extension of the file + auto extension = file_name.extension().string(); + BackedDataElements data_elements; + if (extension == ".csv") { + PX_ASSIGN_OR_RETURN(data_elements, DataElementsFromCSV(f)); + } else if (extension == ".json") { + PX_ASSIGN_OR_RETURN(data_elements, DataElementsFromJSON(f)); + } else { + if (allow_unstructured) { + LOG(WARNING) << absl::Substitute("Unsupported file type: $0, treating each line as a single column", extension); + PX_ASSIGN_OR_RETURN(data_elements, DataElementsForUnstructuredFile()); + } else { + // TODO(ddelnano): If file extension is blank this isn't a helpful error message. + return error::Internal("Unsupported file type: $0", extension); + } + } + + f.seekg(0, std::ios::beg); + return std::make_pair(std::move(data_elements), std::move(f)); +} + +} // namespace + +StatusOr> FileSourceConnector::Create( + std::string_view source_name, const std::filesystem::path file_name) { + auto host_path = px::system::Config::GetInstance().ToHostPath(file_name); + PX_ASSIGN_OR_RETURN(auto data_elements_and_file, DataElementsFromFile(host_path)); + auto& [data_elements, file] = data_elements_and_file; + + // Get just the filename and extension + auto name = host_path.filename().string(); + std::unique_ptr table_schema = + DynamicDataTableSchema::Create(name, "", std::move(data_elements)); + return std::unique_ptr(new FileSourceConnector( + source_name, std::move(host_path), std::move(file), std::move(table_schema))); +} + +FileSourceConnector::FileSourceConnector(std::string_view source_name, + const std::filesystem::path& file_name, std::ifstream file, + std::unique_ptr table_schema) + : SourceConnector(source_name, ArrayView(&table_schema->Get(), 1)), + name_(source_name), + file_name_(file_name), + file_(std::move(file)), + table_schema_(std::move(table_schema)), + transfer_specs_({ + {".json", {&FileSourceConnector::TransferDataFromJSON}}, + {".csv", {&FileSourceConnector::TransferDataFromCSV}}, + {"", {&FileSourceConnector::TransferDataFromUnstructuredFile}}, + {".log", {&FileSourceConnector::TransferDataFromUnstructuredFile}}, + }) {} + +Status FileSourceConnector::InitImpl() { + sampling_freq_mgr_.set_period(kSamplingPeriod); + push_freq_mgr_.set_period(kPushPeriod); + return Status::OK(); +} + +Status FileSourceConnector::StopImpl() { + file_.close(); + return Status::OK(); +} + +constexpr int kMaxLines = 1000; + +void FileSourceConnector::TransferDataFromJSON(DataTable::DynamicRecordBuilder* /*r*/, + uint64_t nanos, const std::string& line) { + rapidjson::Document d; + rapidjson::ParseResult ok = d.Parse(line.c_str()); + if (!ok) { + LOG(ERROR) << absl::Substitute("Failed to parse JSON: $0 $1", line, + rapidjson::GetParseError_En(ok.Code())); + return; + } + DataTable::DynamicRecordBuilder r(data_tables_[0]); + const auto& columns = table_schema_->Get().elements(); + + for (size_t col = 0; col < columns.size(); col++) { + const auto& column = columns[col]; + std::string key(column.name()); + // time_ is inserted by stirling and not within the polled file + if (key == "time_") { + r.Append(col, types::Time64NSValue(nanos)); + continue; + } else if (key == "uuid") { + sole::uuid u = sole::uuid4(); + r.Append(col, types::UInt128Value(u.ab, u.cd)); + continue; + } + const auto& value = d[key.c_str()]; + switch (column.type()) { + case types::DataType::INT64: + r.Append(col, types::Int64Value(value.GetInt())); + break; + case types::DataType::FLOAT64: + r.Append(col, types::Float64Value(value.GetDouble())); + break; + case types::DataType::STRING: + if (value.IsArray() || value.IsObject()) { + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + value.Accept(writer); + r.Append(col, types::StringValue(buffer.GetString()), kMaxStringBytes); + } else { + r.Append(col, types::StringValue(value.GetString()), kMaxStringBytes); + } + break; + case types::DataType::BOOLEAN: + r.Append(col, types::BoolValue(value.GetBool())); + break; + default: + LOG(FATAL) << absl::Substitute( + "Failed to insert field into DataTable: unsupported type '$0'", + types::DataType_Name(column.type())); + } + } + return; +} + +void FileSourceConnector::TransferDataFromUnstructuredFile(DataTable::DynamicRecordBuilder* /*r*/, + uint64_t nanos, const std::string& line) { + DataTable::DynamicRecordBuilder r(data_tables_[0]); + r.Append(0, types::Time64NSValue(nanos)); + sole::uuid u = sole::uuid4(); + r.Append(1, types::UInt128Value(u.ab, u.cd)); + r.Append(2, types::StringValue(line), kMaxStringBytes); + return; +} + +void FileSourceConnector::TransferDataFromCSV(DataTable::DynamicRecordBuilder* r, uint64_t nanos, + const std::string& line) { + PX_UNUSED(r); + PX_UNUSED(nanos); + PX_UNUSED(line); + return; +} + +void FileSourceConnector::TransferDataImpl(ConnectorContext* /* ctx */) { + DCHECK_EQ(data_tables_.size(), 1U) << "Only one table is allowed per FileSourceConnector."; + int i = 0; + auto extension = file_name_.extension().string(); + auto transfer_fn = transfer_specs_.at(extension).transfer_fn; + + auto now = std::chrono::system_clock::now(); + auto duration = now.time_since_epoch(); + uint64_t nanos = std::chrono::duration_cast(duration).count(); + auto before_pos = file_.tellg(); + while (i < kMaxLines) { + std::string line; + std::getline(file_, line); + + if (file_.eof() || line.empty()) { + file_.clear(); + auto after_pos = file_.tellg(); + if (after_pos == last_pos_) { + LOG_EVERY_N(INFO, 100) << absl::Substitute("Reached EOF for file=$0 eof count=$1 pos=", + file_name_.string(), eof_count_) + << after_pos; + eof_count_++; + + // TODO(ddlenano): Using a file's inode is a better way to detect file rotation. For now, + // this will suffice. + std::ifstream s(file_name_, std::ios::ate | std::ios::binary); + if (s.tellg() < after_pos) { + LOG(INFO) << "Detected file rotation, resetting file position"; + file_.close(); + file_.open(file_name_, std::ios::in); + } + } + break; + } + + transfer_fn(*this, nullptr, nanos, line); + i++; + } + auto after_pos = file_.tellg(); + last_pos_ = after_pos; + monitor_.AppendStreamStatusRecord(file_name_, after_pos - before_pos, ""); +} + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/file_source/file_source_connector.h b/src/stirling/source_connectors/file_source/file_source_connector.h new file mode 100644 index 00000000000..1525327a652 --- /dev/null +++ b/src/stirling/source_connectors/file_source/file_source_connector.h @@ -0,0 +1,87 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include +#include +#include + +#include "src/stirling/core/source_connector.h" +#include "src/stirling/utils/monitor.h" + +namespace px { +namespace stirling { + +class FileSourceConnector : public SourceConnector { + using pos_type = std::ifstream::pos_type; + + public: + static constexpr auto kSamplingPeriod = std::chrono::milliseconds{100}; + // Set this high enough to avoid the following error: + // F20250129 00:05:30.980778 2527479 source_connector.cc:64] Failed to push data. Message = + // Table_id 1 doesn't exist. + // + // This occurs when the Stirling data table has data but the table store hasn't received its + // schema yet. I'm not sure why the dynamic tracer doesn't experience this case. + static constexpr auto kPushPeriod = std::chrono::milliseconds{7000}; + + static StatusOr > Create(std::string_view source_name, + const std::filesystem::path file_name); + + FileSourceConnector() = delete; + ~FileSourceConnector() override = default; + + protected: + explicit FileSourceConnector(std::string_view source_name, const std::filesystem::path& file_name, + std::ifstream file, + std::unique_ptr table_schema); + Status InitImpl() override; + Status StopImpl() override; + void TransferDataImpl(ConnectorContext* ctx) override; + + private: + void TransferDataFromUnstructuredFile(DataTable::DynamicRecordBuilder* builder, uint64_t nanos, + const std::string& line); + void TransferDataFromJSON(DataTable::DynamicRecordBuilder* builder, uint64_t nanos, + const std::string& line); + void TransferDataFromCSV(DataTable::DynamicRecordBuilder* builder, uint64_t nanos, + const std::string& line); + + struct FileTransferSpec { + std::function + transfer_fn; + }; + std::string name_; + const std::filesystem::path file_name_; + std::ifstream file_; + std::unique_ptr table_schema_; + absl::flat_hash_map transfer_specs_; + int eof_count_ = 0; + pos_type last_pos_ = 0; + StirlingMonitor& monitor_ = *StirlingMonitor::GetInstance(); +}; + +StatusOr DataElementsFromJSON(std::ifstream& f_stream); +StatusOr DataElementsFromCSV(std::ifstream& f_stream); +StatusOr DataElementsForUnstructuredFile(); + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/file_source/file_source_connector_test.cc b/src/stirling/source_connectors/file_source/file_source_connector_test.cc new file mode 100644 index 00000000000..4b5dba3c6b2 --- /dev/null +++ b/src/stirling/source_connectors/file_source/file_source_connector_test.cc @@ -0,0 +1,82 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include "src/common/testing/testing.h" +#include "src/stirling/source_connectors/file_source/file_source_connector.h" + +namespace px { +namespace stirling { + +TEST(FileSourceConnectorTest, DataElementsFromJSON) { + const auto file_path = + testing::BazelRunfilePath("src/stirling/source_connectors/file_source/testdata/test.json"); + auto stream = std::ifstream(file_path); + auto result = DataElementsFromJSON(stream); + ASSERT_OK(result); + BackedDataElements elements = std::move(result.ValueOrDie()); + + ASSERT_EQ(elements.elements().size(), 8); + EXPECT_EQ(elements.elements()[0].name(), "time_"); + EXPECT_EQ(elements.elements()[0].type(), types::DataType::TIME64NS); + EXPECT_EQ(elements.elements()[1].name(), "uuid"); + EXPECT_EQ(elements.elements()[1].type(), types::DataType::UINT128); + EXPECT_EQ(elements.elements()[2].name(), "id"); + EXPECT_EQ(elements.elements()[2].type(), types::DataType::INT64); + EXPECT_EQ(elements.elements()[3].name(), "active"); + EXPECT_EQ(elements.elements()[3].type(), types::DataType::BOOLEAN); + EXPECT_EQ(elements.elements()[4].name(), "score"); + EXPECT_EQ(elements.elements()[4].type(), types::DataType::FLOAT64); + EXPECT_EQ(elements.elements()[5].name(), "name"); + EXPECT_EQ(elements.elements()[5].type(), types::DataType::STRING); + EXPECT_EQ(elements.elements()[6].name(), "object"); + EXPECT_EQ(elements.elements()[6].type(), types::DataType::STRING); + EXPECT_EQ(elements.elements()[7].name(), "arr"); + EXPECT_EQ(elements.elements()[7].type(), types::DataType::STRING); +} + +TEST(FileSourceConnectorTest, DISABLED_DataElementsFromJSON_UnsupportedTypes) { + const auto file_path = testing::BazelRunfilePath( + "src/stirling/source_connectors/file_source/testdata/unsupported.json"); + auto stream = std::ifstream(file_path); + auto result = DataElementsFromJSON(stream); + ASSERT_EQ(result.ok(), false); + ASSERT_EQ(result.status().msg(), + "Unable to parse JSON key 'unsupported': unsupported type: Object"); +} + +TEST(FileSourceConnectorTest, DataElementsForUnstructuredFile) { + + const auto file_path = testing::BazelRunfilePath( + "src/stirling/source_connectors/file_source/testdata/kern.log"); + auto stream = std::ifstream(file_path); + auto result = DataElementsForUnstructuredFile(); + ASSERT_OK(result); + BackedDataElements elements = std::move(result.ValueOrDie()); + EXPECT_EQ(elements.elements()[0].name(), "time_"); + EXPECT_EQ(elements.elements()[0].type(), types::DataType::TIME64NS); + EXPECT_EQ(elements.elements()[1].name(), "uuid"); + EXPECT_EQ(elements.elements()[1].type(), types::DataType::UINT128); + EXPECT_EQ(elements.elements()[2].name(), "raw_line"); + EXPECT_EQ(elements.elements()[2].type(), types::DataType::STRING); +} + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/file_source/stirling_fs_test.cc b/src/stirling/source_connectors/file_source/stirling_fs_test.cc new file mode 100644 index 00000000000..6ce799e7326 --- /dev/null +++ b/src/stirling/source_connectors/file_source/stirling_fs_test.cc @@ -0,0 +1,225 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include + +#include "src/common/base/base.h" +#include "src/common/testing/testing.h" +#include "src/stirling/core/source_registry.h" +#include "src/stirling/core/types.h" +#include "src/stirling/stirling.h" + +namespace px { +namespace stirling { + +using ::px::testing::BazelRunfilePath; +using ::testing::SizeIs; +using ::testing::StrEq; + +//----------------------------------------------------------------------------- +// Test fixture and shared code +//----------------------------------------------------------------------------- + +class StirlingFileSourceTest : public ::testing::Test { + protected: + void SetUp() override { + std::unique_ptr registry = std::make_unique(); + stirling_ = Stirling::Create(std::move(registry)); + + // Set function to call on data pushes. + stirling_->RegisterDataPushCallback( + absl::bind_front(&StirlingFileSourceTest::AppendData, this)); + } + + Status AppendData(uint64_t /*table_id*/, types::TabletID /*tablet_id*/, + std::unique_ptr record_batch) { + record_batches_.push_back(std::move(record_batch)); + return Status::OK(); + } + + StatusOr WaitForStatus(sole::uuid trace_id) { + StatusOr s; + do { + s = stirling_->GetFileSourceInfo(trace_id); + std::this_thread::sleep_for(std::chrono::seconds(1)); + } while (!s.ok() && s.code() == px::statuspb::Code::RESOURCE_UNAVAILABLE); + + return s; + } + + std::optional FindFieldIndex(const stirlingpb::TableSchema& schema, + std::string_view field_name) { + int idx = 0; + for (const auto& e : schema.elements()) { + if (e.name() == field_name) { + return idx; + } + ++idx; + } + return {}; + } + + void DeployFileSource(std::string file_name, bool trigger_stop = true) { + sole::uuid id = sole::uuid4(); + stirling_->RegisterFileSource(id, file_name); + + // Should deploy. + stirlingpb::Publish publication; + ASSERT_OK_AND_ASSIGN(publication, WaitForStatus(id)); + + // Check the incremental publication change. + ASSERT_EQ(publication.published_info_classes_size(), 1); + info_class_ = publication.published_info_classes(0); + + // Run Stirling data collector. + ASSERT_OK(stirling_->RunAsThread()); + + // Wait to capture some data. + while (record_batches_.empty()) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + + if (trigger_stop) { + ASSERT_OK(stirling_->RemoveFileSource(id)); + + // Should get removed. + EXPECT_EQ(WaitForStatus(id).code(), px::statuspb::Code::NOT_FOUND); + + stirling_->Stop(); + } + } + + std::unique_ptr stirling_; + std::vector> record_batches_; + stirlingpb::InfoClass info_class_; +}; + +class FileSourceJSONTest : public StirlingFileSourceTest { + protected: + const std::string kFilePath = + BazelRunfilePath("src/stirling/source_connectors/file_source/testdata/test.json"); +}; + +TEST_F(FileSourceJSONTest, ParsesJSONFile) { + DeployFileSource(kFilePath); + EXPECT_THAT(record_batches_, SizeIs(1)); + auto& rb = record_batches_[0]; + // Expect there to be 8 columns. time_ and the 4 cols from the JSON file. + EXPECT_EQ(rb->size(), 8); + + for (size_t i = 0; i < rb->size(); ++i) { + auto col_wrapper = rb->at(i); + // The JSON file has 10 lines. + EXPECT_EQ(col_wrapper->Size(), 10); + } +} + +TEST_F(FileSourceJSONTest, ContinuesReadingAfterEOFReached) { + std::string file_name = "./test.json"; + std::ofstream ofs(file_name, std::ios::app); + if (!ofs) { + LOG(FATAL) << absl::Substitute("Failed to open file= $0 received error=$1", kFilePath, strerror(errno)); + } + // FileSourceConnector parses the first line to infer the file's schema, an empty file will cause an error. + ofs << R"({"id": 0, "active": false, "score": 6.28, "name": "item0", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]})" << std::endl; + + DeployFileSource(file_name, false); + EXPECT_THAT(record_batches_, SizeIs(1)); + auto& rb = record_batches_[0]; + // Expect there to be 8 columns. time_ and the 4 cols from the JSON file. + EXPECT_EQ(rb->size(), 8); + + for (size_t i = 0; i < rb->size(); ++i) { + auto col_wrapper = rb->at(i); + // TODO(ddelnano): Clean up these log messages and add better assertions for uint128 case + if (i == 1) { + LOG(INFO) << col_wrapper->Get(0).val; + LOG(INFO) << col_wrapper->Get(1).val; + } else if (i == 6) { + LOG(INFO) << col_wrapper->Get(0); + EXPECT_EQ(col_wrapper->Get(0), R"({"a":1,"b":2})"); + } else if (i == 7) { + LOG(INFO) << col_wrapper->Get(0); + EXPECT_EQ(col_wrapper->Get(0), R"([0,1,2])"); + } + // The file's first row batch has 1 line + EXPECT_EQ(col_wrapper->Size(), 1); + } + + ofs << R"({"id": 1, "active": false, "score": 6.28, "name": "item1", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]})" << std::endl; + ofs.flush(); + ofs.close(); + + while (record_batches_.size() < 2) { + std::this_thread::sleep_for(std::chrono::seconds(3)); + LOG(INFO) << "Waiting for more data..."; + } + + auto& rb2 = record_batches_[1]; + for (size_t i = 0; i < rb2->size(); ++i) { + auto col_wrapper = rb2->at(i); + // The file's second row batch has 1 line + EXPECT_EQ(col_wrapper->Size(), 1); + } +} + +TEST_F(FileSourceJSONTest, ContinuesReadingAfterFileRotation) { + std::string file_name = "./test2.json"; + std::ofstream ofs(file_name, std::ios::app); + if (!ofs) { + LOG(FATAL) << absl::Substitute("Failed to open file= $0 received error=$1", kFilePath, strerror(errno)); + } + // FileSourceConnector parses the first line to infer the file's schema, an empty file will cause an error. + ofs << R"({"id": 0, "active": false, "score": 6.28, "name": "item0", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]})" << std::endl; + ofs << R"({"id": 1, "active": false, "score": 6.28, "name": "item1", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]})" << std::endl; + + DeployFileSource(file_name, false); + EXPECT_THAT(record_batches_, SizeIs(1)); + auto& rb = record_batches_[0]; + // Expect there to be 8 columns. time_ and the 4 cols from the JSON file. + EXPECT_EQ(rb->size(), 8); + + for (size_t i = 0; i < rb->size(); ++i) { + auto col_wrapper = rb->at(i); + // The file's first row batch has 2 lines + EXPECT_EQ(col_wrapper->Size(), 2); + } + + std::ofstream ofs2(file_name, std::ios::trunc); + ofs2 << R"({"id": 2, "active": false, "score": 6.28, "name": "item2", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]})" << std::endl; + ofs2.flush(); + ofs.close(); + + while (record_batches_.size() < 2) { + std::this_thread::sleep_for(std::chrono::seconds(3)); + LOG(INFO) << "Waiting for more data..."; + } + + auto& rb2 = record_batches_[1]; + for (size_t i = 0; i < rb2->size(); ++i) { + auto col_wrapper = rb2->at(i); + // The file's second row batch has 1 line + EXPECT_EQ(col_wrapper->Size(), 1); + } +} + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/file_source/testdata/kern.log b/src/stirling/source_connectors/file_source/testdata/kern.log new file mode 100644 index 00000000000..fed434d43a4 --- /dev/null +++ b/src/stirling/source_connectors/file_source/testdata/kern.log @@ -0,0 +1,5 @@ +2025-03-05T22:30:12.313406+00:00 dev-vm kernel: ll header: 00000000: ff ff ff ff ff ff 42 01 0a 81 00 01 08 06 +2025-03-05T22:30:18.313309+00:00 dev-vm kernel: IPv4: martian source 10.129.0.8 from 10.129.0.1, on dev ens4 +2025-03-05T22:30:18.313333+00:00 dev-vm kernel: ll header: 00000000: ff ff ff ff ff ff 42 01 0a 81 00 01 08 06 +2025-03-05T22:30:24.313240+00:00 dev-vm kernel: IPv4: martian source 10.129.0.8 from 10.129.0.1, on dev ens4 +2025-03-05T22:30:24.313268+00:00 dev-vm kernel: ll header: 00000000: ff ff ff ff ff ff 42 01 0a 81 00 01 08 06 diff --git a/src/stirling/source_connectors/file_source/testdata/test.json b/src/stirling/source_connectors/file_source/testdata/test.json new file mode 100644 index 00000000000..f65c3fabafb --- /dev/null +++ b/src/stirling/source_connectors/file_source/testdata/test.json @@ -0,0 +1,10 @@ +{"id": 1, "active": true, "score": 3.14, "name": "item1", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 2, "active": false, "score": 2.71, "name": "item2", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 3, "active": true, "score": 1.41, "name": "item3", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 4, "active": false, "score": 1.73, "name": "item4", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 5, "active": true, "score": 0.99, "name": "item5", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 6, "active": false, "score": 2.18, "name": "item6", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 7, "active": true, "score": 3.67, "name": "item7", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 8, "active": false, "score": 4.56, "name": "item8", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 9, "active": true, "score": 5.32, "name": "item9", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} +{"id": 10, "active": false, "score": 6.28, "name": "item10", "object": {"a": 1, "b": 2}, "arr": [0, 1, 2]} diff --git a/src/stirling/source_connectors/file_source/testdata/unsupported.json b/src/stirling/source_connectors/file_source/testdata/unsupported.json new file mode 100644 index 00000000000..455064ea679 --- /dev/null +++ b/src/stirling/source_connectors/file_source/testdata/unsupported.json @@ -0,0 +1 @@ +{"id": 1, "active": true, "score": 3.14, "name": "item1", "unsupported": {"a": 1, "b": 2}} diff --git a/src/stirling/source_connectors/stirling_error/BUILD.bazel b/src/stirling/source_connectors/stirling_error/BUILD.bazel index 15f25dc41af..c0c843d88ca 100644 --- a/src/stirling/source_connectors/stirling_error/BUILD.bazel +++ b/src/stirling/source_connectors/stirling_error/BUILD.bazel @@ -17,7 +17,7 @@ load("//bazel:pl_build_system.bzl", "pl_cc_bpf_test", "pl_cc_library") load("//src/stirling/source_connectors/perf_profiler/testing:testing.bzl", "agent_libs", "px_jattach", "stirling_profiler_java_args") -package(default_visibility = ["//src/stirling:__subpackages__"]) +package(default_visibility = ["//src/stirling:__subpackages__", "//src/vizier/services/agent/shared/manager:__subpackages__"]) pl_cc_library( name = "cc_library", @@ -42,6 +42,7 @@ pl_cc_bpf_test( args = stirling_profiler_java_args, data = agent_libs + [ px_jattach, + "testdata/test.json", "//src/stirling/source_connectors/perf_profiler/testing/java:java_image_base-java-profiler-test-image-omit-frame-pointer.tar", ], flaky = True, diff --git a/src/stirling/source_connectors/stirling_error/sink_results_table.h b/src/stirling/source_connectors/stirling_error/sink_results_table.h new file mode 100644 index 00000000000..d2f15bbfa57 --- /dev/null +++ b/src/stirling/source_connectors/stirling_error/sink_results_table.h @@ -0,0 +1,51 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "src/common/base/base.h" +#include "src/stirling/core/canonical_types.h" +#include "src/stirling/core/output.h" +#include "src/stirling/core/source_connector.h" + +namespace px { +namespace stirling { + +// clang-format off +constexpr DataElement kSinkResultsElements[] = { + canonical_data_elements::kTime, + canonical_data_elements::kUPID, + {"bytes_transferred", "", + types::DataType::INT64, types::SemanticType::ST_NONE, types::PatternType::GENERAL}, + {"destination", "The planpb::OperatorType enum of the sink", + types::DataType::INT64, types::SemanticType::ST_NONE, types::PatternType::GENERAL}, + {"stream_id", "The ID of the stream of interest.", + types::DataType::STRING, types::SemanticType::ST_NONE, types::PatternType::GENERAL}, +}; + +constexpr DataTableSchema kSinkResultsTable { + "sink_results", + "This table contains the sink node results during execution.", + kSinkResultsElements +}; + +// clang-format on +DEFINE_PRINT_TABLE(SinkResults); + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/stirling_error/stirling_error_bpf_test.cc b/src/stirling/source_connectors/stirling_error/stirling_error_bpf_test.cc index 7eb9f8a910c..df3b567982b 100644 --- a/src/stirling/source_connectors/stirling_error/stirling_error_bpf_test.cc +++ b/src/stirling/source_connectors/stirling_error/stirling_error_bpf_test.cc @@ -106,6 +106,23 @@ std::vector ToProbeRecordVector( return result; } +std::vector ToStreamRecordVector( + const std::vector>& record_batches) { + std::vector result; + + for (size_t rb_idx = 0; rb_idx < record_batches.size(); ++rb_idx) { + auto& rb = *record_batches[rb_idx]; + for (size_t idx = 0; idx < rb.front()->Size(); ++idx) { + StreamStatusRecord r; + r.stream_id = rb[2]->Get(idx).string(); + r.bytes_sent = rb[3]->Get(idx).val; + r.info = rb[4]->Get(idx).string(); + result.push_back(r); + } + } + return result; +} + // A SourceConnector that fails on Init. class FaultyConnector : public SourceConnector { public: @@ -195,6 +212,25 @@ class StirlingErrorTest : public ::testing::Test { return trace_id; } + StatusOr DeployFileSource(const std::string& program_text) { + // Compile file source. + PX_ASSIGN_OR_RETURN(auto compiled_file_source, + px::carnot::planner::compiler::CompileFileSource(program_text)); + + // Register tracepoint. + sole::uuid id = sole::uuid4(); + stirling_->RegisterFileSource(id, std::move(compiled_file_source.glob_pattern())); + + // Wait for deployment to finish. + StatusOr s; + do { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + s = stirling_->GetFileSourceInfo(id); + } while (!s.ok() && s.code() == px::statuspb::Code::RESOURCE_UNAVAILABLE); + + return id; + } + Status AppendData(uint64_t table_id, types::TabletID tablet_id, std::unique_ptr record_batch) { PX_UNUSED(tablet_id); @@ -208,6 +244,8 @@ class StirlingErrorTest : public ::testing::Test { source_status_batches_.push_back(std::move(record_batch)); } else if (table_name == "probe_status") { probe_status_batches_.push_back(std::move(record_batch)); + } else if (table_name == "stream_status") { + stream_status_batches_.push_back(std::move(record_batch)); } } return Status::OK(); @@ -221,6 +259,9 @@ class StirlingErrorTest : public ::testing::Test { } else if constexpr (std::is_same_v) { return WaitAndExpectRecords([&]() { return ToProbeRecordVector(probe_status_batches_); }, expected); + } else if constexpr (std::is_same_v) { + return WaitAndExpectRecords([&]() { return ToStreamRecordVector(stream_status_batches_); }, + expected); } else { static_assert(always_false); } @@ -230,6 +271,7 @@ class StirlingErrorTest : public ::testing::Test { std::unique_ptr stirling_; std::vector> source_status_batches_; std::vector> probe_status_batches_; + std::vector> stream_status_batches_; }; TEST_F(StirlingErrorTest, SourceConnectorInitOK) { @@ -527,5 +569,55 @@ TEST_F(StirlingErrorTest, PerfProfilerNoPreserveFramePointer) { EXPECT_THAT(probe_records, IsEmpty()); } +// Deploy a FileSource stream and record the progress of the stream throughput. +// Expects one message for each TransferDataImpl call to the FileSource. +TEST_F(StirlingErrorTest, StreamStatusThroughput) { + // Register StirlingErrorConnector. + std::unique_ptr registry = std::make_unique(); + registry->RegisterOrDie("stirling_error"); + + // Run Stirling. + InitStirling(std::move(registry)); + ASSERT_OK(stirling_->RunAsThread()); + ASSERT_OK(stirling_->WaitUntilRunning(std::chrono::seconds(5))); + + auto file_stream_pxl = R"( +import pxlog +glob_pattern = '$0' +table_name = '$1' +pxlog.FileSource(glob_pattern, table_name, "1m") +)"; + + const auto glob_pattern = + BazelRunfilePath("src/stirling/source_connectors/stirling_error/testdata/test.json").string(); + const auto table_name = "test.json"; + + ASSERT_OK_AND_ASSIGN( + auto id, DeployFileSource(absl::Substitute(file_stream_pxl, glob_pattern, table_name))); + + // Stirling Error Source Connector Initialization. + WaitAndExpectStatusRecords(std::vector{ + {.source_connector = "stirling_error", + .status = px::statuspb::Code::OK, + .error = "", + .context = "Init"}, + }); + // Tracepoint deployed. + WaitAndExpectStatusRecords( + std::vector{{.stream_id = glob_pattern, .bytes_sent = 587, .info = ""}}); + + // Remove file source; + ASSERT_OK(stirling_->RemoveFileSource(id)); + StatusOr s; + do { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + s = stirling_->GetFileSourceInfo(id); + } while (s.ok()); + + // TODO(ddelnano): Add file source removal message assertion. + + stirling_->Stop(); +} + } // namespace stirling } // namespace px diff --git a/src/stirling/source_connectors/stirling_error/stirling_error_connector.cc b/src/stirling/source_connectors/stirling_error/stirling_error_connector.cc index e186c53b60b..1be86eb2794 100644 --- a/src/stirling/source_connectors/stirling_error/stirling_error_connector.cc +++ b/src/stirling/source_connectors/stirling_error/stirling_error_connector.cc @@ -39,7 +39,7 @@ Status StirlingErrorConnector::InitImpl() { Status StirlingErrorConnector::StopImpl() { return Status::OK(); } void StirlingErrorConnector::TransferDataImpl(ConnectorContext* ctx) { - DCHECK_EQ(data_tables_.size(), 2U) << "StirlingErrorConnector has two data tables."; + DCHECK_EQ(data_tables_.size(), 4U) << "StirlingErrorConnector has four data tables."; if (data_tables_[kStirlingErrorTableNum] != nullptr) { TransferStirlingErrorTable(ctx, data_tables_[kStirlingErrorTableNum]); @@ -48,6 +48,10 @@ void StirlingErrorConnector::TransferDataImpl(ConnectorContext* ctx) { if (data_tables_[kProbeStatusTableNum] != nullptr) { TransferProbeStatusTable(ctx, data_tables_[kProbeStatusTableNum]); } + + if (data_tables_[kStreamStatusTableNum] != nullptr) { + TransferStreamStatusTable(ctx, data_tables_[kStreamStatusTableNum]); + } } void StirlingErrorConnector::TransferStirlingErrorTable(ConnectorContext* ctx, @@ -79,5 +83,18 @@ void StirlingErrorConnector::TransferProbeStatusTable(ConnectorContext* ctx, } } +void StirlingErrorConnector::TransferStreamStatusTable(ConnectorContext* ctx, + DataTable* data_table) { + md::UPID upid = md::UPID(ctx->GetASID(), pid_, start_time_); + for (auto& record : monitor_.ConsumeStreamStatusRecords()) { + DataTable::RecordBuilder<&kStreamStatusTable> r(data_table, record.timestamp_ns); + r.Append(static_cast(record.timestamp_ns)); + r.Append(upid.value()); + r.Append(std::move(record.stream_id)); + r.Append(static_cast(record.bytes_sent)); + r.Append(std::move(record.info)); + } +} + } // namespace stirling } // namespace px diff --git a/src/stirling/source_connectors/stirling_error/stirling_error_connector.h b/src/stirling/source_connectors/stirling_error/stirling_error_connector.h index 0dae755c947..21db2a7c7f6 100644 --- a/src/stirling/source_connectors/stirling_error/stirling_error_connector.h +++ b/src/stirling/source_connectors/stirling_error/stirling_error_connector.h @@ -26,7 +26,9 @@ #include "src/common/base/base.h" #include "src/stirling/core/source_connector.h" #include "src/stirling/source_connectors/stirling_error/probe_status_table.h" +#include "src/stirling/source_connectors/stirling_error/sink_results_table.h" #include "src/stirling/source_connectors/stirling_error/stirling_error_table.h" +#include "src/stirling/source_connectors/stirling_error/stream_status_table.h" #include "src/stirling/utils/monitor.h" namespace px { @@ -37,9 +39,11 @@ class StirlingErrorConnector : public SourceConnector { static constexpr std::string_view kName = "stirling_error"; static constexpr auto kSamplingPeriod = std::chrono::milliseconds{1000}; static constexpr auto kPushPeriod = std::chrono::milliseconds{1000}; - static constexpr auto kTables = MakeArray(kStirlingErrorTable, kProbeStatusTable); + static constexpr auto kTables = + MakeArray(kStirlingErrorTable, kProbeStatusTable, kStreamStatusTable, kSinkResultsTable); static constexpr uint32_t kStirlingErrorTableNum = TableNum(kTables, kStirlingErrorTable); static constexpr uint32_t kProbeStatusTableNum = TableNum(kTables, kProbeStatusTable); + static constexpr uint32_t kStreamStatusTableNum = TableNum(kTables, kStreamStatusTable); StirlingErrorConnector() = delete; ~StirlingErrorConnector() override = default; @@ -59,6 +63,7 @@ class StirlingErrorConnector : public SourceConnector { void TransferStirlingErrorTable(ConnectorContext* ctx, DataTable* data_table); void TransferProbeStatusTable(ConnectorContext* ctx, DataTable* data_table); + void TransferStreamStatusTable(ConnectorContext* ctx, DataTable* data_table); StirlingMonitor& monitor_ = *StirlingMonitor::GetInstance(); int32_t pid_ = -1; diff --git a/src/stirling/source_connectors/stirling_error/stream_status_table.h b/src/stirling/source_connectors/stirling_error/stream_status_table.h new file mode 100644 index 00000000000..160694cbcad --- /dev/null +++ b/src/stirling/source_connectors/stirling_error/stream_status_table.h @@ -0,0 +1,51 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "src/common/base/base.h" +#include "src/stirling/core/canonical_types.h" +#include "src/stirling/core/output.h" +#include "src/stirling/core/source_connector.h" + +namespace px { +namespace stirling { + +// clang-format off +constexpr DataElement kStreamStatusElements[] = { + canonical_data_elements::kTime, + canonical_data_elements::kUPID, + {"stream_id", "The ID of the stream of interest. For file source connector this is glob_pattern", + types::DataType::STRING, types::SemanticType::ST_NONE, types::PatternType::GENERAL}, + {"bytes_sent", "The error messages of the deployment or event, if any", + types::DataType::INT64, types::SemanticType::ST_BYTES, types::PatternType::METRIC_COUNTER}, + {"info", "Optional extra info provided as a JSON", + types::DataType::STRING, types::SemanticType::ST_NONE, types::PatternType::GENERAL}, +}; + +constexpr DataTableSchema kStreamStatusTable { + "stream_status", + "This table contains the status of streams Stirling is ingested across various source connectors", + kStreamStatusElements +}; + +// clang-format on +DEFINE_PRINT_TABLE(StreamStatus); + +} // namespace stirling +} // namespace px diff --git a/src/stirling/source_connectors/stirling_error/testdata/test.json b/src/stirling/source_connectors/stirling_error/testdata/test.json new file mode 100644 index 00000000000..96b30cbd35c --- /dev/null +++ b/src/stirling/source_connectors/stirling_error/testdata/test.json @@ -0,0 +1,10 @@ +{"id": 1, "active": true, "score": 3.14, "name": "item1"} +{"id": 2, "active": false, "score": 2.71, "name": "item2"} +{"id": 3, "active": true, "score": 1.41, "name": "item3"} +{"id": 4, "active": false, "score": 1.73, "name": "item4"} +{"id": 5, "active": true, "score": 0.99, "name": "item5"} +{"id": 6, "active": false, "score": 2.18, "name": "item6"} +{"id": 7, "active": true, "score": 3.67, "name": "item7"} +{"id": 8, "active": false, "score": 4.56, "name": "item8"} +{"id": 9, "active": true, "score": 5.32, "name": "item9"} +{"id": 10, "active": false, "score": 6.28, "name": "item10"} diff --git a/src/stirling/source_connectors/stirling_error/testdata/unsupported.json b/src/stirling/source_connectors/stirling_error/testdata/unsupported.json new file mode 100644 index 00000000000..455064ea679 --- /dev/null +++ b/src/stirling/source_connectors/stirling_error/testdata/unsupported.json @@ -0,0 +1 @@ +{"id": 1, "active": true, "score": 3.14, "name": "item1", "unsupported": {"a": 1, "b": 2}} diff --git a/src/stirling/stirling.cc b/src/stirling/stirling.cc index 5b15a5ecabd..fd35286854e 100644 --- a/src/stirling/stirling.cc +++ b/src/stirling/stirling.cc @@ -46,6 +46,7 @@ #include "src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector.h" #include "src/stirling/source_connectors/dynamic_bpftrace/utils.h" #include "src/stirling/source_connectors/dynamic_tracer/dynamic_trace_connector.h" +#include "src/stirling/source_connectors/file_source/file_source_connector.h" #include "src/stirling/source_connectors/jvm_stats/jvm_stats_connector.h" #include "src/stirling/source_connectors/network_stats/network_stats_connector.h" #include "src/stirling/source_connectors/perf_profiler/perf_profile_connector.h" @@ -200,8 +201,11 @@ class StirlingImpl final : public Stirling { void RegisterTracepoint( sole::uuid uuid, std::unique_ptr program) override; + void RegisterFileSource(sole::uuid id, std::string file_name) override; StatusOr GetTracepointInfo(sole::uuid trace_id) override; + StatusOr GetFileSourceInfo(sole::uuid trace_id) override; Status RemoveTracepoint(sole::uuid trace_id) override; + Status RemoveFileSource(sole::uuid trace_id) override; void GetPublishProto(stirlingpb::Publish* publish_pb) override; void RegisterDataPushCallback(DataPushCallback f) override { data_push_callback_ = f; } void RegisterAgentMetadataCallback(AgentMetadataCallback f) override { @@ -224,9 +228,12 @@ class StirlingImpl final : public Stirling { void UpdateDynamicTraceStatus(const sole::uuid& uuid, const StatusOr& status); + void UpdateFileSourceStatus(const sole::uuid& uuid, const StatusOr& status); + private: // Adds a source to Stirling, and updates all state accordingly. - Status AddSource(std::unique_ptr source); + Status AddSource(std::unique_ptr source, + std::optional mutation_id = {}); // Removes a source and all its info classes from stirling. Status RemoveSource(std::string_view source_name); @@ -239,6 +246,11 @@ class StirlingImpl final : public Stirling { // Destroys a dynamic tracing source created by DeployDynamicTraceConnector. void DestroyDynamicTraceConnector(sole::uuid trace_id); + // Creates and deploys file source connector + void DeployFileSourceConnector(sole::uuid trace_id, std::string file_name); + + void DestroyFileSourceConnector(sole::uuid id); + // Main run implementation. void RunCore(); @@ -277,6 +289,10 @@ class StirlingImpl final : public Stirling { absl::flat_hash_map> dynamic_trace_status_map_ ABSL_GUARDED_BY(dynamic_trace_status_map_lock_); + absl::base_internal::SpinLock file_source_status_map_lock_; + absl::flat_hash_map> file_source_status_map_ + ABSL_GUARDED_BY(file_source_status_map_lock_); + StirlingMonitor& monitor_ = *StirlingMonitor::GetInstance(); struct DynamicTraceInfo { @@ -288,6 +304,15 @@ class StirlingImpl final : public Stirling { absl::flat_hash_map trace_id_info_map_ ABSL_GUARDED_BY(dynamic_trace_status_map_lock_); + struct FileSourceInfo { + std::string source_connector; + std::string file_name; + std::string output_table; + }; + + absl::flat_hash_map file_source_info_map_ + ABSL_GUARDED_BY(file_source_status_map_lock_); + // RunCoreStats tracks how much work is accomplished in each run core iteration, // and it also keeps a histogram of sleep durations. RunCoreStats run_core_stats_; @@ -427,7 +452,8 @@ std::unique_ptr StirlingImpl::GetContext() { return std::unique_ptr(new SystemWideStandaloneContext()); } -Status StirlingImpl::AddSource(std::unique_ptr source) { +Status StirlingImpl::AddSource(std::unique_ptr source, + std::optional mutation_id) { PX_RETURN_IF_ERROR(source->Init()); absl::base_internal::SpinLockHolder lock(&info_class_mgrs_lock_); @@ -438,6 +464,9 @@ Status StirlingImpl::AddSource(std::unique_ptr source) { LOG(INFO) << absl::Substitute("Adding info class: [$0/$1]", source->name(), schema.name()); auto mgr = std::make_unique(schema); mgr->SetSourceConnector(source.get()); + if (mutation_id.has_value()) { + mgr->SetMutationId(mutation_id.value()); + } data_tables.push_back(mgr->data_table()); info_class_mgrs_.push_back(std::move(mgr)); } @@ -499,6 +528,13 @@ Status StirlingImpl::RemoveSource(std::string_view source_name) { namespace { constexpr char kDynTraceSourcePrefix[] = "DT_"; +constexpr char kFileSourcePrefix[] = "LOG_"; + +StatusOr> CreateFileSourceConnector(sole::uuid id, + std::string file_name) { + auto name = absl::StrCat(kFileSourcePrefix, id.str()); + return FileSourceConnector::Create(name, file_name); +} StatusOr> CreateDynamicSourceConnector( sole::uuid trace_id, @@ -535,6 +571,82 @@ StatusOr> CreateDynamicSourceConnector( } // namespace +void StirlingImpl::UpdateFileSourceStatus(const sole::uuid& id, + const StatusOr& s) { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + file_source_status_map_[id] = s; + + // Find program name and log dynamic trace status update to Stirling Monitor. + auto it = file_source_info_map_.find(id); + if (it != file_source_info_map_.end()) { + FileSourceInfo& file_source_info = it->second; + + // Build info JSON with trace_id and output_table. + ::px::utils::JSONObjectBuilder builder; + builder.WriteKV("trace_id", id.str()); + if (s.ok()) { + builder.WriteKV("output_table", file_source_info.output_table); + } + + monitor_.AppendSourceStatusRecord(file_source_info.source_connector, s.status(), + builder.GetString()); + + // Clean up map if status is not ok. When status is RESOURCE_UNAVAILABLE, either deployment + // or removal is pending, so don't clean up. + if (!s.ok() && s.code() != statuspb::Code::RESOURCE_UNAVAILABLE) { + file_source_info_map_.erase(id); + } + } +} + +void StirlingImpl::DeployFileSourceConnector(sole::uuid id, std::string file_name) { + auto timer = ElapsedTimer(); + timer.Start(); + + // Try creating the DynamicTraceConnector--which compiles BCC code. + // On failure, set status and exit. + auto source_or_s = CreateFileSourceConnector(id, file_name); + if (!source_or_s.ok()) { + Status ret_status(px::statuspb::Code::INTERNAL, source_or_s.msg()); + UpdateFileSourceStatus(id, ret_status); + LOG(INFO) << ret_status.ToString(); + return; + } + auto source = source_or_s.ConsumeValueOrDie(); + + LOG(INFO) << absl::Substitute("FileSourceConnector [$0] created in $1 ms.", source->name(), + timer.ElapsedTime_us() / 1000.0); + + // Cache table schema name as source will be moved below. + std::string output_name(source->table_schemas()[0].name()); + + { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + auto it = file_source_info_map_.find(id); + if (it != file_source_info_map_.end()) { + file_source_info_map_[id].output_table = output_name; + } + } + + timer.Start(); + auto s = AddSource(std::move(source), id.str()); + if (!s.ok()) { + UpdateFileSourceStatus(id, s); + LOG(INFO) << s.ToString(); + return; + } + LOG(INFO) << absl::Substitute("FileSourceConnector [$0] created in $1 ms.", id.str(), + timer.ElapsedTime_us() / 1000.0); + + stirlingpb::Publish publication; + { + absl::base_internal::SpinLockHolder lock(&info_class_mgrs_lock_); + PopulatePublishProto(&publication, info_class_mgrs_, output_name); + } + + UpdateFileSourceStatus(id, publication); +} + void StirlingImpl::DeployDynamicTraceConnector( sole::uuid trace_id, std::unique_ptr program) { @@ -563,7 +675,7 @@ void StirlingImpl::DeployDynamicTraceConnector( timer.Start(); // Next, try adding the source (this actually tries to deploy BPF code). // On failure, set status and exit, but do this outside the lock for efficiency reasons. - RETURN_IF_ERROR(AddSource(std::move(source))); + RETURN_IF_ERROR(AddSource(std::move(source), trace_id.str())); LOG(INFO) << absl::Substitute("DynamicTrace [$0]: Deployed BPF program in $1 ms.", trace_id.str(), timer.ElapsedTime_us() / 1000.0); @@ -594,6 +706,29 @@ void StirlingImpl::DestroyDynamicTraceConnector(sole::uuid trace_id) { } } +void StirlingImpl::DestroyFileSourceConnector(sole::uuid trace_id) { + auto timer = ElapsedTimer(); + timer.Start(); + + // Remove from stirling. + auto s = RemoveSource(kFileSourcePrefix + trace_id.str()); + if (!s.ok()) { + UpdateFileSourceStatus(trace_id, s); + LOG(INFO) << s.ToString(); + return; + } + + LOG(INFO) << absl::Substitute("FileSource [$0]: Removed file polling $1 ms.", trace_id.str(), + timer.ElapsedTime_us() / 1000.0); + + // Remove from map. + { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + file_source_status_map_.erase(trace_id); + file_source_info_map_.erase(trace_id); + } +} + #undef RETURN_ERROR #undef RETURN_IF_ERROR #undef ASSIGN_OR_RETURN @@ -652,6 +787,29 @@ void StirlingImpl::RegisterTracepoint( t.detach(); } +void StirlingImpl::RegisterFileSource(sole::uuid id, std::string file_name) { + // Temporary: Check if the target exists on this PEM, otherwise return NotFound. + // TODO(oazizi): Need to think of a better way of doing this. + // Need to differentiate errors caused by the binary not being on the host vs + // other errors. Also should consider races with binary creation/deletion. + { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + std::string source_connector = "file_source"; + file_source_info_map_[id] = {.source_connector = std::move(source_connector), + .file_name = file_name, + .output_table = ""}; + } + + // Initialize the status of this trace to pending. + { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + file_source_status_map_[id] = error::ResourceUnavailable("Waiting for file polling to start."); + } + + auto t = std::thread(&StirlingImpl::DeployFileSourceConnector, this, id, file_name); + t.detach(); +} + StatusOr StirlingImpl::GetTracepointInfo(sole::uuid trace_id) { absl::base_internal::SpinLockHolder lock(&dynamic_trace_status_map_lock_); @@ -664,6 +822,18 @@ StatusOr StirlingImpl::GetTracepointInfo(sole::uuid trace_i return s; } +StatusOr StirlingImpl::GetFileSourceInfo(sole::uuid trace_id) { + absl::base_internal::SpinLockHolder lock(&file_source_status_map_lock_); + + auto iter = file_source_status_map_.find(trace_id); + if (iter == file_source_status_map_.end()) { + return error::NotFound("FileSource $0 not found.", trace_id.str()); + } + + StatusOr s = iter->second; + return s; +} + Status StirlingImpl::RemoveTracepoint(sole::uuid trace_id) { // Change the status of this trace to pending while we delete it. UpdateDynamicTraceStatus(trace_id, error::ResourceUnavailable("Probe removal in progress.")); @@ -674,6 +844,16 @@ Status StirlingImpl::RemoveTracepoint(sole::uuid trace_id) { return Status::OK(); } +Status StirlingImpl::RemoveFileSource(sole::uuid trace_id) { + // Change the status of this trace to pending while we delete it. + UpdateFileSourceStatus(trace_id, error::ResourceUnavailable("file source removal in progress.")); + + auto t = std::thread(&StirlingImpl::DestroyFileSourceConnector, this, trace_id); + t.detach(); + + return Status::OK(); +} + void StirlingImpl::GetPublishProto(stirlingpb::Publish* publish_pb) { absl::base_internal::SpinLockHolder lock(&info_class_mgrs_lock_); PopulatePublishProto(publish_pb, info_class_mgrs_); diff --git a/src/stirling/stirling.h b/src/stirling/stirling.h index 16a1d65c6e0..86231e05193 100644 --- a/src/stirling/stirling.h +++ b/src/stirling/stirling.h @@ -122,6 +122,10 @@ class Stirling : public NotCopyable { * Returns the status of the probe registration for the trace identified by the input ID. */ virtual StatusOr GetTracepointInfo(sole::uuid trace_id) = 0; + virtual StatusOr GetFileSourceInfo(sole::uuid trace_id) = 0; + + virtual void RegisterFileSource(sole::uuid id, std::string file_name) = 0; + virtual Status RemoveFileSource(sole::uuid id) = 0; /** * Remove a dynamically created tracepoint. diff --git a/src/stirling/testing/common.h b/src/stirling/testing/common.h index c754380eb34..ef8fda4a796 100644 --- a/src/stirling/testing/common.h +++ b/src/stirling/testing/common.h @@ -176,7 +176,7 @@ inline types::ColumnWrapperRecordBatch ExtractRecordsMatchingPID(DataTable* data class Timeout { public: - explicit Timeout(std::chrono::nanoseconds timeout = std::chrono::minutes{5}) + explicit Timeout(std::chrono::nanoseconds timeout = std::chrono::minutes{1}) : timeout_(timeout), start_(std::chrono::steady_clock::now()) {} bool TimedOut() { return !((std::chrono::steady_clock::now() - start_) < timeout_); } diff --git a/src/stirling/testing/overloads.h b/src/stirling/testing/overloads.h index f29062e857f..8a4a8b008f1 100644 --- a/src/stirling/testing/overloads.h +++ b/src/stirling/testing/overloads.h @@ -53,6 +53,16 @@ inline void PrintTo(const ProbeStatusRecord& r, std::ostream* os) { r.info); } +inline bool operator==(const StreamStatusRecord& a, const StreamStatusRecord& b) { + return (a.stream_id == b.stream_id) && (a.bytes_sent == b.bytes_sent) && (a.info == b.info); +} + +inline void PrintTo(const StreamStatusRecord& r, std::ostream* os) { + *os << absl::Substitute( + "StreamStatusRecord{timestamp_ns: $0, stream_id: $1, bytes_sent: $2, info: $3}", + r.timestamp_ns, r.stream_id, r.bytes_sent, r.info); +} + inline bool operator==(const TcpStatsRecord& a, const TcpStatsRecord& b) { return (a.remote_port == b.remote_port) && (a.remote_addr == b.remote_addr) && (a.tx == b.tx) && (a.rx == b.rx) && (a.retransmits == b.retransmits); diff --git a/src/stirling/testing/stirling_mock.h b/src/stirling/testing/stirling_mock.h index 9a997af8a90..fad1c29e550 100644 --- a/src/stirling/testing/stirling_mock.h +++ b/src/stirling/testing/stirling_mock.h @@ -18,6 +18,8 @@ #pragma once +#include + #include #include #include @@ -40,6 +42,9 @@ class MockStirling : public Stirling { (override)); MOCK_METHOD(StatusOr, GetTracepointInfo, (sole::uuid trace_id), (override)); MOCK_METHOD(Status, RemoveTracepoint, (sole::uuid trace_id), (override)); + MOCK_METHOD(void, RegisterFileSource, (sole::uuid trace_id, std::string file_name), (override)); + MOCK_METHOD(StatusOr, GetFileSourceInfo, (sole::uuid trace_id), (override)); + MOCK_METHOD(Status, RemoveFileSource, (sole::uuid trace_id), (override)); MOCK_METHOD(void, GetPublishProto, (stirlingpb::Publish * publish_pb), (override)); MOCK_METHOD(void, RegisterDataPushCallback, (DataPushCallback f), (override)); MOCK_METHOD(void, RegisterAgentMetadataCallback, (AgentMetadataCallback f), (override)); diff --git a/src/stirling/utils/monitor.cc b/src/stirling/utils/monitor.cc index 673e92da35d..2341f3ee018 100644 --- a/src/stirling/utils/monitor.cc +++ b/src/stirling/utils/monitor.cc @@ -74,6 +74,12 @@ void StirlingMonitor::AppendProbeStatusRecord(const std::string& source_connecto {CurrentTimeNS(), source_connector, tracepoint, status.code(), status.msg(), info}); } +void StirlingMonitor::AppendStreamStatusRecord(const std::string& stream_id, + const int64_t bytes_sent, const std::string& info) { + absl::base_internal::SpinLockHolder lock(&stream_status_lock_); + stream_status_records_.push_back({CurrentTimeNS(), stream_id, bytes_sent, info}); +} + std::vector StirlingMonitor::ConsumeSourceStatusRecords() { absl::base_internal::SpinLockHolder lock(&source_status_lock_); return std::move(source_status_records_); @@ -84,5 +90,10 @@ std::vector StirlingMonitor::ConsumeProbeStatusRecords() { return std::move(probe_status_records_); } +std::vector StirlingMonitor::ConsumeStreamStatusRecords() { + absl::base_internal::SpinLockHolder lock(&stream_status_lock_); + return std::move(stream_status_records_); +} + } // namespace stirling } // namespace px diff --git a/src/stirling/utils/monitor.h b/src/stirling/utils/monitor.h index 214a2f49e39..596dfc7fed9 100644 --- a/src/stirling/utils/monitor.h +++ b/src/stirling/utils/monitor.h @@ -50,6 +50,14 @@ struct ProbeStatusRecord { std::string info = ""; }; +// Status of stream processing +struct StreamStatusRecord { + int64_t timestamp_ns = 0; + std::string stream_id = ""; + int64_t bytes_sent = 0; + std::string info = ""; +}; + class StirlingMonitor : NotCopyMoveable { public: static StirlingMonitor* GetInstance() { @@ -65,10 +73,13 @@ class StirlingMonitor : NotCopyMoveable { // Stirling Error Reporting. void AppendProbeStatusRecord(const std::string& source_connector, const std::string& tracepoint, const Status& status, const std::string& info); + void AppendStreamStatusRecord(const std::string& stream_id, const int64_t bytes_sent, + const std::string& info); void AppendSourceStatusRecord(const std::string& source_connector, const Status& status, const std::string& context); std::vector ConsumeProbeStatusRecords(); std::vector ConsumeSourceStatusRecords(); + std::vector ConsumeStreamStatusRecords(); static constexpr auto kCrashWindow = std::chrono::seconds{5}; @@ -81,10 +92,13 @@ class StirlingMonitor : NotCopyMoveable { std::vector probe_status_records_ ABSL_GUARDED_BY(probe_status_lock_); // Records of Stirling Source Connector status. std::vector source_status_records_ ABSL_GUARDED_BY(source_status_lock_); + // Records of Stirling stream connector status. + std::vector stream_status_records_ ABSL_GUARDED_BY(stream_status_lock_); // Lock to protect probe and source records. absl::base_internal::SpinLock probe_status_lock_; absl::base_internal::SpinLock source_status_lock_; + absl::base_internal::SpinLock stream_status_lock_; prometheus::Counter& java_proc_crashed_during_attach_; }; diff --git a/src/table_store/schema/relation.cc b/src/table_store/schema/relation.cc index da087835e1b..d2ca4a35605 100644 --- a/src/table_store/schema/relation.cc +++ b/src/table_store/schema/relation.cc @@ -38,6 +38,11 @@ Relation::Relation() = default; Relation::Relation(ColTypeArray col_types, ColNameArray col_names) : Relation(col_types, col_names, ColDescArray(col_types.size(), "")) {} +Relation::Relation(ColTypeArray col_types, ColNameArray col_names, std::optional mutation_id) + : Relation(col_types, col_names, ColDescArray(col_types.size(), "")) { + mutation_id_ = mutation_id; + } + Relation::Relation(ColTypeArray col_types, ColNameArray col_names, ColDescArray col_desc) : Relation(col_types, col_names, col_desc, ColSemanticTypeArray(col_types.size(), types::ST_NONE)) {} @@ -161,6 +166,9 @@ std::string Relation::DebugString() const { for (size_t i = 0; i < col_types_.size(); ++i) { col_info_as_str.push_back(absl::StrCat(col_names_[i], ":", types::ToString(col_types_[i]))); } + if (mutation_id_.has_value()) { + col_info_as_str.push_back(absl::Substitute("mutation_id:$0", mutation_id_.value())); + } return "[" + absl::StrJoin(col_info_as_str, ", ") + "]"; } @@ -173,6 +181,9 @@ Status Relation::ToProto(table_store::schemapb::Relation* relation_proto) const col_pb->set_column_name(GetColumnName(col_idx)); col_pb->set_column_semantic_type(GetColumnSemanticType(col_idx)); } + if (mutation_id_.has_value()) { + relation_proto->set_mutation_id(mutation_id_.value()); + } return Status::OK(); } Status Relation::FromProto(const table_store::schemapb::Relation* relation_pb) { @@ -184,6 +195,9 @@ Status Relation::FromProto(const table_store::schemapb::Relation* relation_pb) { auto column = relation_pb->columns(idx); AddColumn(column.column_type(), column.column_name(), column.column_semantic_type()); } + if (relation_pb->mutation_id().size() > 0) { + mutation_id_ = relation_pb->mutation_id(); + } return Status::OK(); } diff --git a/src/table_store/schema/relation.h b/src/table_store/schema/relation.h index f0105b65c00..5f45cdfe9d4 100644 --- a/src/table_store/schema/relation.h +++ b/src/table_store/schema/relation.h @@ -43,6 +43,7 @@ class Relation { Relation(); // Constructor for Relation that initializes with a list of column types. explicit Relation(ColTypeArray col_types, ColNameArray col_names); + explicit Relation(ColTypeArray col_types, ColNameArray col_names, std::optional mutation_id); explicit Relation(ColTypeArray col_types, ColNameArray col_names, ColDescArray col_desc); explicit Relation(ColTypeArray col_types, ColNameArray col_names, ColSemanticTypeArray col_semantic_types); @@ -118,12 +119,15 @@ class Relation { return out << relation.DebugString(); } + std::optional mutation_id() const { return mutation_id_; } + private: ColTypeArray col_types_; ColNameArray col_names_; ColDescArray col_desc_; ColSemanticTypeArray col_semantic_types_; ColPatternTypeArray col_pattern_types_; + std::optional mutation_id_; }; } // namespace schema diff --git a/src/table_store/schemapb/schema.pb.go b/src/table_store/schemapb/schema.pb.go index 93aada07afb..f7a66f48acf 100755 --- a/src/table_store/schemapb/schema.pb.go +++ b/src/table_store/schemapb/schema.pb.go @@ -486,8 +486,9 @@ func (m *RowBatchData) GetEos() bool { } type Relation struct { - Columns []*Relation_ColumnInfo `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` - Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` + Columns []*Relation_ColumnInfo `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` + MutationId string `protobuf:"bytes,3,opt,name=mutation_id,json=mutationId,proto3" json:"mutation_id,omitempty"` } func (m *Relation) Reset() { *m = Relation{} } @@ -536,6 +537,13 @@ func (m *Relation) GetDesc() string { return "" } +func (m *Relation) GetMutationId() string { + if m != nil { + return m.MutationId + } + return "" +} + type Relation_ColumnInfo struct { ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` ColumnType typespb.DataType `protobuf:"varint,2,opt,name=column_type,json=columnType,proto3,enum=px.types.DataType" json:"column_type,omitempty"` @@ -734,58 +742,59 @@ func init() { } var fileDescriptor_837edaf494876c32 = []byte{ - // 810 bytes of a gzipped FileDescriptorProto + // 825 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x77, 0xe3, 0xd8, 0x75, 0xde, 0x6e, 0xaa, 0x32, 0x2a, 0x50, 0x7c, 0xd8, 0x50, 0x37, - 0x81, 0x1e, 0x90, 0x0d, 0x4e, 0x65, 0xa2, 0x4a, 0x70, 0x30, 0x6d, 0xe4, 0xa8, 0xc2, 0x42, 0xe3, - 0x70, 0xe1, 0x80, 0x35, 0xde, 0x4c, 0x93, 0x15, 0xbb, 0x3b, 0xab, 0x9d, 0x71, 0x1d, 0xdf, 0x10, - 0x17, 0xae, 0x7c, 0x06, 0x4e, 0x7c, 0x0c, 0x8e, 0x1c, 0x73, 0xac, 0x10, 0x42, 0xc4, 0xb9, 0x70, - 0xcc, 0x47, 0x40, 0xf3, 0x66, 0x36, 0x5e, 0xa3, 0x2e, 0xe1, 0x92, 0x3c, 0x8f, 0xff, 0xef, 0x37, - 0x7f, 0xbd, 0xff, 0x5b, 0x2f, 0xec, 0xc9, 0x3c, 0xec, 0x2a, 0x36, 0x8d, 0xf9, 0x44, 0x2a, 0x91, - 0xf3, 0xae, 0x0c, 0xcf, 0x78, 0xc2, 0xb2, 0xa9, 0x2d, 0x3a, 0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, + 0xfd, 0x67, 0x11, 0x3a, 0xaf, 0x16, 0xa1, 0xfb, 0xd3, 0x55, 0xe8, 0x5c, 0x5c, 0x85, 0xce, 0xcb, + 0xab, 0xd0, 0xf9, 0xa6, 0x55, 0x32, 0xc7, 0x4d, 0xfc, 0xa2, 0xed, 0xff, 0x1b, 0x00, 0x00, 0xff, + 0xff, 0x2c, 0x17, 0xd8, 0xc3, 0x4f, 0x07, 0x00, 0x00, } func (this *BooleanColumn) Equal(that interface{}) bool { @@ -1204,6 +1213,9 @@ func (this *Relation) Equal(that interface{}) bool { if this.Desc != that1.Desc { return false } + if this.MutationId != that1.MutationId { + return false + } return true } func (this *Relation_ColumnInfo) Equal(that interface{}) bool { @@ -1447,12 +1459,13 @@ func (this *Relation) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 6) + s := make([]string, 0, 7) s = append(s, "&schemapb.Relation{") if this.Columns != nil { s = append(s, "Columns: "+fmt.Sprintf("%#v", this.Columns)+",\n") } s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") + s = append(s, "MutationId: "+fmt.Sprintf("%#v", this.MutationId)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1983,6 +1996,13 @@ func (m *Relation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MutationId) > 0 { + i -= len(m.MutationId) + copy(dAtA[i:], m.MutationId) + i = encodeVarintSchema(dAtA, i, uint64(len(m.MutationId))) + i-- + dAtA[i] = 0x1a + } if len(m.Desc) > 0 { i -= len(m.Desc) copy(dAtA[i:], m.Desc) @@ -2385,6 +2405,10 @@ func (m *Relation) Size() (n int) { if l > 0 { n += 1 + l + sovSchema(uint64(l)) } + l = len(m.MutationId) + if l > 0 { + n += 1 + l + sovSchema(uint64(l)) + } return n } @@ -2630,6 +2654,7 @@ func (this *Relation) String() string { s := strings.Join([]string{`&Relation{`, `Columns:` + repeatedStringForColumns + `,`, `Desc:` + fmt.Sprintf("%v", this.Desc) + `,`, + `MutationId:` + fmt.Sprintf("%v", this.MutationId) + `,`, `}`, }, "") return s @@ -3836,6 +3861,38 @@ func (m *Relation) Unmarshal(dAtA []byte) error { } m.Desc = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MutationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSchema + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSchema + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSchema + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MutationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSchema(dAtA[iNdEx:]) diff --git a/src/table_store/schemapb/schema.proto b/src/table_store/schemapb/schema.proto index 25b11d7f6c4..5762aed73d2 100644 --- a/src/table_store/schemapb/schema.proto +++ b/src/table_store/schemapb/schema.proto @@ -90,6 +90,8 @@ message Relation { repeated ColumnInfo columns = 1; // Description of the table. string desc = 2; + // Mutation id of the table if one exists. + string mutation_id = 3; } // A table serialized as proto. diff --git a/src/table_store/table/internal/store_with_row_accounting.h b/src/table_store/table/internal/store_with_row_accounting.h index 842f91b8b81..d26f18816fa 100644 --- a/src/table_store/table/internal/store_with_row_accounting.h +++ b/src/table_store/table/internal/store_with_row_accounting.h @@ -53,6 +53,8 @@ void constexpr_else_static_assert_false() { static_assert(always_false, "constexpr else block reached"); } +class HotOnlyStore; + /** * StoreWithRowTimeAccounting stores a deque of batches (hot or cold) and keeps track of the first * and last unique RowID's for each batch, as well as the first and last times for each batch (if @@ -75,12 +77,28 @@ class StoreWithRowTimeAccounting { StoreWithRowTimeAccounting(const schema::Relation& rel, int64_t time_col_idx) : rel_(rel), time_col_idx_(time_col_idx) {} + Status AddBatchSliceToRowBatch(const TBatch& batch, size_t row_offset, size_t batch_size, + const std::vector& cols, + schema::RowBatch* output_rb) const { + if constexpr (std::is_same_v) { + for (auto col_idx : cols) { + auto arr = batch[col_idx]->Slice(row_offset, batch_size); + PX_RETURN_IF_ERROR(output_rb->AddColumn(arr)); + } + return Status::OK(); + } else if constexpr (std::is_same_v) { + return batch.AddBatchSliceToRowBatch(row_offset, batch_size, cols, output_rb); + } else { + constexpr_else_static_assert_false(); + } + } + /** * GetNextRowBatch returns the next row batch in this store after the given unique row id. * @param last_read_row_id, pointer to the unique RowID of the last read row. The outputted batch * should include only rows with a RowID greater than this RowID. After determining the output * batch, this pointer is updated to point to the RowID of the last row in the outputted batch. - * @param hints, pointer to a BatchHints object (usually from a Table::Cursor), that provides a + * @param hints, pointer to a BatchHints object (usually from a Cursor), that provides a * hint to the store about which batch should be next. If the hint is correct, no searching for * the right batch is required, otherwise searching is performed as usual. This is purely an * optimization and passing a `nullptr` for hints is accepted. @@ -158,16 +176,16 @@ class StoreWithRowTimeAccounting { * PopFront removes the first batch in the store, and returns an rvalue reference to it. * @return rvalue reference to the removed batch. */ - TBatch&& PopFront() { + TBatch PopFront() { DCHECK(!batches_.empty()); first_batch_id_++; row_ids_.pop_front(); if (time_col_idx_ != -1) times_.pop_front(); - auto&& front = std::move(batches_.front()); + auto front = std::move(batches_.front()); batches_.pop_front(); - return std::move(front); + return front; } /** @@ -384,28 +402,14 @@ class StoreWithRowTimeAccounting { } } - Status AddBatchSliceToRowBatch(const TBatch& batch, size_t row_offset, size_t batch_size, - const std::vector& cols, - schema::RowBatch* output_rb) const { - if constexpr (std::is_same_v) { - for (auto col_idx : cols) { - auto arr = batch[col_idx]->Slice(row_offset, batch_size); - PX_RETURN_IF_ERROR(output_rb->AddColumn(arr)); - } - return Status::OK(); - } else if constexpr (std::is_same_v) { - return batch.AddBatchSliceToRowBatch(row_offset, batch_size, cols, output_rb); - } else { - constexpr_else_static_assert_false(); - } - } - BatchID first_batch_id_ = 0; const schema::Relation& rel_; const int64_t time_col_idx_; std::deque batches_; std::deque row_ids_; std::deque times_; + + friend HotOnlyStore; }; } // namespace internal diff --git a/src/table_store/table/table.cc b/src/table_store/table/table.cc index a3bac23f4e5..6ec35efd369 100644 --- a/src/table_store/table/table.cc +++ b/src/table_store/table/table.cc @@ -48,13 +48,13 @@ DEFINE_int32(table_store_table_size_limit, namespace px { namespace table_store { -Table::Cursor::Cursor(const Table* table, StartSpec start, StopSpec stop) +Cursor::Cursor(const Table* table, StartSpec start, StopSpec stop) : table_(table), hints_(internal::BatchHints{}) { AdvanceToStart(start); StopStateFromSpec(std::move(stop)); } -void Table::Cursor::AdvanceToStart(const StartSpec& start) { +void Cursor::AdvanceToStart(const StartSpec& start) { switch (start.type) { case StartSpec::StartType::StartAtTime: { last_read_row_id_ = table_->FindRowIDFromTimeFirstGreaterThanOrEqual(start.start_time) - 1; @@ -71,7 +71,7 @@ void Table::Cursor::AdvanceToStart(const StartSpec& start) { } } -void Table::Cursor::UpdateStopStateForStopAtTime() { +void Cursor::UpdateStopStateForStopAtTime() { if (stop_.stop_row_id_final) { // Once stop_row_id is set, we know the stop time is already within the table so we don't have // to update it anymore. @@ -85,7 +85,7 @@ void Table::Cursor::UpdateStopStateForStopAtTime() { } } -void Table::Cursor::StopStateFromSpec(StopSpec&& stop) { +void Cursor::StopStateFromSpec(StopSpec&& stop) { stop_.spec = std::move(stop); switch (stop_.spec.type) { case StopSpec::StopType::CurrentEndOfTable: { @@ -110,7 +110,7 @@ void Table::Cursor::StopStateFromSpec(StopSpec&& stop) { } } -bool Table::Cursor::NextBatchReady() { +bool Cursor::NextBatchReady() { switch (stop_.spec.type) { case StopSpec::StopType::StopAtTimeOrEndOfTable: case StopSpec::StopType::CurrentEndOfTable: { @@ -127,7 +127,7 @@ bool Table::Cursor::NextBatchReady() { return false; } -bool Table::Cursor::Done() { +bool Cursor::Done() { auto next_row_id = last_read_row_id_ + 1; switch (stop_.spec.type) { case StopSpec::StopType::StopAtTimeOrEndOfTable: @@ -149,29 +149,28 @@ bool Table::Cursor::Done() { return false; } -void Table::Cursor::UpdateStopSpec(Cursor::StopSpec stop) { StopStateFromSpec(std::move(stop)); } +void Cursor::UpdateStopSpec(Cursor::StopSpec stop) { StopStateFromSpec(std::move(stop)); } -internal::RowID* Table::Cursor::LastReadRowID() { return &last_read_row_id_; } +internal::RowID* Cursor::LastReadRowID() { return &last_read_row_id_; } -internal::BatchHints* Table::Cursor::Hints() { return &hints_; } +internal::BatchHints* Cursor::Hints() { return &hints_; } -std::optional Table::Cursor::StopRowID() const { +std::optional Cursor::StopRowID() const { if (stop_.spec.type == StopSpec::StopType::Infinite) { return std::nullopt; } return stop_.stop_row_id; } -StatusOr> Table::Cursor::GetNextRowBatch( +StatusOr> Cursor::GetNextRowBatch( const std::vector& cols) { return table_->GetNextRowBatch(this, cols); } -Table::Table(std::string_view table_name, const schema::Relation& relation, size_t max_table_size, - size_t compacted_batch_size) - : metrics_(&(GetMetricsRegistry()), std::string(table_name)), - rel_(relation), - max_table_size_(max_table_size), +HotColdTable::HotColdTable(std::string_view table_name, const schema::Relation& relation, + size_t max_table_size, size_t compacted_batch_size) + : Table(TableMetrics(&(GetMetricsRegistry()), std::string(table_name)), relation, + max_table_size), compacted_batch_size_(compacted_batch_size), // TODO(james): move mem_pool into constructor. compactor_(rel_, arrow::default_memory_pool()) { @@ -189,7 +188,7 @@ Table::Table(std::string_view table_name, const schema::Relation& relation, size rel_, time_col_idx_); } -Status Table::ToProto(table_store::schemapb::Table* table_proto) const { +Status HotColdTable::ToProto(table_store::schemapb::Table* table_proto) const { CHECK(table_proto != nullptr); std::vector col_selector; for (int64_t i = 0; i < static_cast(rel_.NumColumns()); i++) { @@ -209,7 +208,7 @@ Status Table::ToProto(table_store::schemapb::Table* table_proto) const { return Status::OK(); } -StatusOr> Table::GetNextRowBatch( +StatusOr> HotColdTable::GetNextRowBatch( Cursor* cursor, const std::vector& cols) const { DCHECK(!cursor->Done()) << "Calling GetNextRowBatch on an exhausted Cursor"; absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); @@ -237,91 +236,7 @@ StatusOr> Table::GetNextRowBatch( return rb; } -Status Table::ExpireRowBatches(int64_t row_batch_size) { - if (row_batch_size > max_table_size_) { - return error::InvalidArgument("RowBatch size ($0) is bigger than maximum table size ($1).", - row_batch_size, max_table_size_); - } - int64_t bytes; - { - absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); - bytes = batch_size_accountant_->HotBytes() + batch_size_accountant_->ColdBytes(); - } - while (bytes + row_batch_size > max_table_size_) { - PX_RETURN_IF_ERROR(ExpireBatch()); - { - absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); - bytes = batch_size_accountant_->HotBytes() + batch_size_accountant_->ColdBytes(); - } - { - absl::base_internal::SpinLockHolder lock(&stats_lock_); - batches_expired_++; - metrics_.batches_expired_counter.Increment(); - } - } - return Status::OK(); -} - -Status Table::WriteRowBatch(const schema::RowBatch& rb) { - // Don't write empty row batches. - if (rb.num_columns() == 0 || rb.ColumnAt(0)->length() == 0) { - return Status::OK(); - } - - internal::RecordOrRowBatch record_or_row_batch(rb); - - PX_RETURN_IF_ERROR(WriteHot(std::move(record_or_row_batch))); - return Status::OK(); -} - -Status Table::TransferRecordBatch( - std::unique_ptr record_batch) { - // Don't transfer over empty row batches. - if (record_batch->empty() || record_batch->at(0)->Size() == 0) { - return Status::OK(); - } - - auto record_batch_w_cache = internal::RecordBatchWithCache{ - std::move(record_batch), - std::vector(rel_.NumColumns()), - std::vector(rel_.NumColumns(), false), - }; - internal::RecordOrRowBatch record_or_row_batch(std::move(record_batch_w_cache)); - - PX_RETURN_IF_ERROR(WriteHot(std::move(record_or_row_batch))); - return Status::OK(); -} - -Status Table::WriteHot(internal::RecordOrRowBatch&& record_or_row_batch) { - // See BatchSizeAccountantNonMutableState for an explanation of the thread safety and necessity of - // NonMutableState. - auto batch_stats = internal::BatchSizeAccountant::CalcBatchStats( - ABSL_TS_UNCHECKED_READ(batch_size_accountant_)->NonMutableState(), record_or_row_batch); - - PX_RETURN_IF_ERROR(ExpireRowBatches(batch_stats.bytes)); - - { - absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); - auto batch_length = record_or_row_batch.Length(); - batch_size_accountant_->NewHotBatch(std::move(batch_stats)); - hot_store_->EmplaceBack(next_row_id_, std::move(record_or_row_batch)); - next_row_id_ += batch_length; - } - - { - absl::base_internal::SpinLockHolder lock(&stats_lock_); - ++batches_added_; - metrics_.batches_added_counter.Increment(); - bytes_added_ += batch_stats.bytes; - metrics_.bytes_added_counter.Increment(batch_stats.bytes); - } - - // Make sure locks are released for this call, since they are reacquired inside. - PX_RETURN_IF_ERROR(UpdateTableMetricGauges()); - return Status::OK(); -} - -Table::RowID Table::FirstRowID() const { +Table::RowID HotColdTable::FirstRowID() const { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); if (cold_store_->Size() > 0) { return cold_store_->FirstRowID(); @@ -333,7 +248,7 @@ Table::RowID Table::FirstRowID() const { return -1; } -Table::RowID Table::LastRowID() const { +Table::RowID HotColdTable::LastRowID() const { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); if (hot_store_->Size() > 0) { @@ -345,7 +260,7 @@ Table::RowID Table::LastRowID() const { return -1; } -Table::Time Table::MaxTime() const { +Table::Time HotColdTable::MaxTime() const { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); if (hot_store_->Size() > 0) { @@ -357,7 +272,7 @@ Table::Time Table::MaxTime() const { return -1; } -Table::RowID Table::FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const { +Table::RowID HotColdTable::FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); auto optional_row_id = cold_store_->FindRowIDFromTimeFirstGreaterThanOrEqual(time); if (optional_row_id.has_value()) { @@ -371,7 +286,7 @@ Table::RowID Table::FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const { return next_row_id_; } -Table::RowID Table::FindRowIDFromTimeFirstGreaterThan(Time time) const { +Table::RowID HotColdTable::FindRowIDFromTimeFirstGreaterThan(Time time) const { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); auto optional_row_id = cold_store_->FindRowIDFromTimeFirstGreaterThan(time); if (optional_row_id.has_value()) { @@ -385,9 +300,7 @@ Table::RowID Table::FindRowIDFromTimeFirstGreaterThan(Time time) const { return next_row_id_; } -schema::Relation Table::GetRelation() const { return rel_; } - -TableStats Table::GetTableStats() const { +TableStats HotColdTable::GetTableStats() const { TableStats info; int64_t min_time = -1; int64_t num_batches = 0; @@ -421,7 +334,7 @@ TableStats Table::GetTableStats() const { return info; } -Status Table::CompactSingleBatchUnlocked(arrow::MemoryPool*) { +Status HotColdTable::CompactSingleBatchUnlocked(arrow::MemoryPool*) { const auto& compaction_spec = batch_size_accountant_->GetNextCompactedBatchSpec(); PX_RETURN_IF_ERROR( @@ -456,7 +369,7 @@ Status Table::CompactSingleBatchUnlocked(arrow::MemoryPool*) { return Status::OK(); } -Status Table::CompactHotToCold(arrow::MemoryPool* mem_pool) { +Status HotColdTable::CompactHotToCold(arrow::MemoryPool* mem_pool) { bool next_ready = false; { absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); @@ -476,7 +389,7 @@ Status Table::CompactHotToCold(arrow::MemoryPool* mem_pool) { return Status::OK(); } -StatusOr Table::ExpireCold() { +StatusOr HotColdTable::ExpireCold() { absl::base_internal::SpinLockHolder cold_lock(&cold_lock_); if (cold_store_->Size() == 0) { return false; @@ -487,17 +400,7 @@ StatusOr Table::ExpireCold() { return true; } -Status Table::ExpireHot() { - absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); - if (hot_store_->Size() == 0) { - return error::InvalidArgument("Failed to expire row batch, no row batches in table"); - } - hot_store_->PopFront(); - batch_size_accountant_->ExpireHotBatch(); - return Status::OK(); -} - -Status Table::ExpireBatch() { +Status HotColdTable::ExpireBatch() { PX_ASSIGN_OR_RETURN(auto expired_cold, ExpireCold()); if (expired_cold) { return Status::OK(); @@ -507,7 +410,7 @@ Status Table::ExpireBatch() { return ExpireHot(); } -Status Table::UpdateTableMetricGauges() { +Status HotColdTable::UpdateTableMetricGauges() { // Update table-level gauge values. auto stats = GetTableStats(); // Set gauge values @@ -528,5 +431,162 @@ Status Table::UpdateTableMetricGauges() { return Status::OK(); } +HotOnlyTable::HotOnlyTable(std::string_view table_name, const schema::Relation& relation, + size_t max_table_size) + : Table(TableMetrics(&(GetMetricsRegistry()), std::string(table_name)), relation, + max_table_size) { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + for (const auto& [i, col_name] : Enumerate(rel_.col_names())) { + if (col_name == "time_" && rel_.GetColumnType(i) == types::DataType::TIME64NS) { + time_col_idx_ = i; + } + } + batch_size_accountant_ = + internal::BatchSizeAccountant::Create(rel_, FLAGS_table_store_table_size_limit); + // TODO(ddelnano): Move this into the base class constructor + hot_store_ = std::make_unique>( + rel_, time_col_idx_); +} + +StatusOr> HotOnlyTable::GetNextRowBatch( + Cursor* /*cursor*/, const std::vector& cols) const { + std::vector col_types; + for (int64_t col_idx : cols) { + DCHECK(static_cast(col_idx) < rel_.NumColumns()); + col_types.push_back(rel_.col_types()[col_idx]); + } + const auto row_desc = schema::RowDescriptor(col_types); + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + if (hot_store_->Size() == 0) { + return schema::RowBatch::WithZeroRows(row_desc, /* eow */ true, + /* eos */ true); + } + auto&& batch = hot_store_->PopFront(); + auto batch_size = batch.Length(); + auto rb = std::make_unique(row_desc, batch_size); + batch_size_accountant_->ExpireHotBatch(); + PX_RETURN_IF_ERROR(hot_store_->AddBatchSliceToRowBatch(batch, 0, batch_size, cols, rb.get())); + return rb; +} + +Table::RowID HotOnlyTable::FirstRowID() const { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + if (hot_store_->Size() > 0) { + return hot_store_->FirstRowID(); + } + return -1; +} + +Table::RowID HotOnlyTable::LastRowID() const { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + if (hot_store_->Size() > 0) { + return hot_store_->LastRowID(); + } + return -1; +} + +Table::RowID HotOnlyTable::FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + auto optional_row_id = hot_store_->FindRowIDFromTimeFirstGreaterThanOrEqual(time); + if (optional_row_id.has_value()) { + return optional_row_id.value(); + } + return next_row_id_; +} + +Table::RowID HotOnlyTable::FindRowIDFromTimeFirstGreaterThan(Time time) const { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + auto optional_row_id = hot_store_->FindRowIDFromTimeFirstGreaterThan(time); + if (optional_row_id.has_value()) { + return optional_row_id.value(); + } + return next_row_id_; +} + +Status HotOnlyTable::ToProto(table_store::schemapb::Table* table_proto) const { + CHECK(table_proto != nullptr); + std::vector col_selector; + for (int64_t i = 0; i < static_cast(rel_.NumColumns()); i++) { + col_selector.push_back(i); + } + + Cursor cursor(this); + while (!cursor.Done()) { + PX_ASSIGN_OR_RETURN(auto cur_rb, cursor.GetNextRowBatch(col_selector)); + auto eos = cursor.Done(); + cur_rb->set_eow(eos); + cur_rb->set_eos(eos); + PX_RETURN_IF_ERROR(cur_rb->ToProto(table_proto->add_row_batches())); + } + + PX_RETURN_IF_ERROR(rel_.ToProto(table_proto->mutable_relation())); + return Status::OK(); +} + +TableStats HotOnlyTable::GetTableStats() const { + TableStats info; + int64_t min_time = -1; + int64_t num_batches = 0; + int64_t hot_bytes = 0; + int64_t cold_bytes = 0; + { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + num_batches += hot_store_->Size(); + hot_bytes = batch_size_accountant_->HotBytes(); + if (min_time == -1) { + min_time = hot_store_->MinTime(); + } + } + absl::base_internal::SpinLockHolder lock(&stats_lock_); + + info.batches_added = batches_added_; + info.batches_expired = batches_expired_; + info.bytes_added = bytes_added_; + info.num_batches = num_batches; + info.bytes = hot_bytes + cold_bytes; + info.hot_bytes = hot_bytes; + info.cold_bytes = cold_bytes; + info.compacted_batches = compacted_batches_; + info.max_table_size = max_table_size_; + info.min_time = min_time; + + return info; +} + +Status HotOnlyTable::CompactHotToCold(arrow::MemoryPool* /*mem_pool*/) { + LOG(INFO) << "Skipping compaction for HotOnlyTable"; + return Status::OK(); +} + +Table::Time HotOnlyTable::MaxTime() const { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + if (hot_store_->Size() > 0) { + return hot_store_->MaxTime(); + } + return -1; +} + +Status HotOnlyTable::ExpireBatch() { return ExpireHot(); } + +Status HotOnlyTable::UpdateTableMetricGauges() { + // Update table-level gauge values. + auto stats = GetTableStats(); + // Set gauge values + metrics_.hot_bytes_gauge.Set(stats.hot_bytes); + metrics_.num_batches_gauge.Set(stats.num_batches); + metrics_.max_table_size_gauge.Set(stats.max_table_size); + // Compute retention gauge + int64_t current_retention_ns = 0; + // If min_time is 0, there is no data in the table. + if (stats.min_time > 0) { + int64_t current_time_ns = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); + current_retention_ns = current_time_ns - stats.min_time; + } + metrics_.retention_ns_gauge.Set(current_retention_ns); + return Status::OK(); +} + } // namespace table_store } // namespace px diff --git a/src/table_store/table/table.h b/src/table_store/table/table.h index c82e9b4e6d8..a26accd562c 100644 --- a/src/table_store/table/table.h +++ b/src/table_store/table/table.h @@ -68,6 +68,316 @@ struct TableStats { int64_t min_time; }; +class Table; + +/** + * Cursor allows iterating the table, while guaranteeing that no row is returned twice (even when + * compactions occur between accesses). {Start,Stop}Spec specify what rows the cursor should begin + * and end at when iterating the cursor. + */ +class Cursor { + using Time = internal::Time; + using RowID = internal::RowID; + + public: + /** + * StartSpec defines where a Cursor should begin within the table. Current options are to start + * at a given time, or start at the first row currently in the table. + */ + struct StartSpec { + enum StartType { + StartAtTime, + CurrentStartOfTable, + }; + StartType type = CurrentStartOfTable; + Time start_time = -1; + }; + + /** + * StopSpec defines when a Cursor should stop and be considered exhausted. Current options are + * to stop at a given time, stop at the last row currently in the table, or infinite (i.e. the + * Cursor never becomes exhausted). + */ + struct StopSpec { + enum StopType { + // Iterating a StopAtTime cursor will return all records with `timestamp <= stop_time`. + // The cursor will not be considered `Done()` until a record with `timestamp > stop_time` is + // added to the table. + // Note that StopAtTime is the most expensive of the StopTypes because it requires holding a + // table lock very briefly on each call to `Done()` or `NextBatchReady()` + StopAtTime, + // Iterating a StopAtTimeOrEndOfTable cursor will return all records with `timestamp <= + // stop_time` that existed in the table at the time of cursor creation. The cursor will be + // considered `Done()` once all records with `timestamp <= stop_time` have been consumed or + // when the end of the table is reached (end of the table is determined at cursor creation + // time). + StopAtTimeOrEndOfTable, + // Iterating a CurrentEndOfTable cursor will return all records in the table at cursor + // creation time. + CurrentEndOfTable, + // An Infinite cursor will never be considered `Done()`. + Infinite, + }; + StopType type = CurrentEndOfTable; + // Only valid for StopAtTime or StopAtTimeOrEndOfTable types. + Time stop_time = -1; + }; + + explicit Cursor(const Table* table) : Cursor(table, StartSpec{}, StopSpec{}) {} + Cursor(const Table* table, StartSpec start, StopSpec stop); + + // In the case of StopType == Infinite or StopType == StopAtTime, this returns whether the table + // has the next batch ready. In the case of StopType == CurrentEndOfTable, this returns !Done(). + // Note that `NextBatchReady() == true` doesn't guarantee that `GetNextRowBatch` will succeed. + // For instance, the desired row batch could have been expired between the call to + // `NextBatchReady()` and `GetNextRowBatch(...)`, and then the row batch after the expired one + // is past the stopping condition. In this case `GetNextRowBatch(...)` will return an error. + bool NextBatchReady(); + StatusOr> GetNextRowBatch(const std::vector& cols); + // In the case of StopType == Infinite, this function always returns false. + bool Done(); + // Change the StopSpec of the cursor. + void UpdateStopSpec(StopSpec stop); + + private: + void AdvanceToStart(const StartSpec& start); + void StopStateFromSpec(StopSpec&& stop); + void UpdateStopStateForStopAtTime(); + + // The following methods are made private so that they are only accessible from Table. + internal::RowID* LastReadRowID(); + internal::BatchHints* Hints(); + std::optional StopRowID() const; + + struct StopState { + StopSpec spec; + RowID stop_row_id; + // If StopSpec.type is StopAtTime, then stop_row_id doesn't become finalized until the time is + // within the table. This bool keeps track of when that happens. + bool stop_row_id_final = false; + }; + const Table* table_; + internal::BatchHints hints_; + RowID last_read_row_id_; + StopState stop_; + + friend class Table; + friend class HotColdTable; + friend class HotOnlyTable; +}; + +class Table : public NotCopyable { + public: + using RecordBatchPtr = internal::RecordBatchPtr; + using ArrowArrayPtr = internal::ArrowArrayPtr; + using ColdBatch = internal::ColdBatch; + using Time = internal::Time; + using TimeInterval = internal::TimeInterval; + using RowID = internal::RowID; + using RowIDInterval = internal::RowIDInterval; + using BatchID = internal::BatchID; + + Table() = delete; + virtual ~Table() = default; + + schema::Relation GetRelation() const { return rel_; } + + /** + * Get a RowBatch of data corresponding to the next data after the given cursor. + * @param cursor the Cursor to get the next row batch after. + * @param cols a vector of column indices to get data for. + * @return a unique ptr to a RowBatch with the requested data. + */ + virtual StatusOr> GetNextRowBatch( + Cursor* cursor, const std::vector& cols) const = 0; + + /** + * Get the unique identifier of the first row in the table. + * If all the data is expired from the table, this returns the last row id that was in the table. + * @return unique identifier of the first row. + */ + virtual RowID FirstRowID() const = 0; + + /** + * Get the unique identifier of the last row in the table. + * If all the data is expired from the table, this returns the last row id that was in the table. + * @return unique identifier of the last row. + */ + virtual RowID LastRowID() const = 0; + + /** + * Find the unique identifier of the first row for which its corresponding time is greater than or + * equal to the given time. + * @param time the time to search for. + * @return unique identifier of the first row with time greater than or equal to the given time. + */ + virtual RowID FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const = 0; + + /** + * Find the unique identifier of the first row for which its corresponding time is greater than + * the given time. + * @param time the time to search for. + * @return unique identifier of the first row with time greater than the given time. + */ + virtual RowID FindRowIDFromTimeFirstGreaterThan(Time time) const = 0; + + /** + * Covert the table and store in passed in proto. + * @param table_proto The table proto to write to. + * @return Status of conversion. + */ + virtual Status ToProto(table_store::schemapb::Table* table_proto) const = 0; + + virtual TableStats GetTableStats() const = 0; + + /** + * Compacts hot batches into compacted_batch_size_ sized cold batches. Each call to + * CompactHotToCold will create a maximum of kMaxBatchesPerCompactionCall cold batches. + * @param mem_pool arrow MemoryPool to be used for creating new cold batches. + */ + virtual Status CompactHotToCold(arrow::MemoryPool* mem_pool) = 0; + + /** + * Transfers the given record batch (from Stirling) into the Table. + * + * @param record_batch the record batch to be appended to the Table. + * @return status + */ + Status TransferRecordBatch(std::unique_ptr record_batch) { + // Don't transfer over empty row batches. + if (record_batch->empty() || record_batch->at(0)->Size() == 0) { + return Status::OK(); + } + + auto record_batch_w_cache = internal::RecordBatchWithCache{ + std::move(record_batch), + std::vector(rel_.NumColumns()), + std::vector(rel_.NumColumns(), false), + }; + internal::RecordOrRowBatch record_or_row_batch(std::move(record_batch_w_cache)); + + PX_RETURN_IF_ERROR(WriteHot(std::move(record_or_row_batch))); + return Status::OK(); + } + + /** + * Writes a row batch to the table. + * @param rb Rowbatch to write to the table. + */ + Status WriteRowBatch(const schema::RowBatch& rb) { + // Don't write empty row batches. + if (rb.num_columns() == 0 || rb.ColumnAt(0)->length() == 0) { + return Status::OK(); + } + + internal::RecordOrRowBatch record_or_row_batch(rb); + + PX_RETURN_IF_ERROR(WriteHot(std::move(record_or_row_batch))); + return Status::OK(); + } + + protected: + virtual Time MaxTime() const = 0; + + virtual Status ExpireBatch() = 0; + + virtual Status UpdateTableMetricGauges() = 0; + + Table(TableMetrics metrics, const schema::Relation& relation, size_t max_table_size) + : metrics_(metrics), rel_(relation), max_table_size_(max_table_size) {} + + Status ExpireHot() { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + if (hot_store_->Size() == 0) { + return error::InvalidArgument("Failed to expire row batch, no row batches in table"); + } + hot_store_->PopFront(); + batch_size_accountant_->ExpireHotBatch(); + return Status::OK(); + } + + Status ExpireRowBatches(int64_t row_batch_size) { + if (row_batch_size > max_table_size_) { + return error::InvalidArgument("RowBatch size ($0) is bigger than maximum table size ($1).", + row_batch_size, max_table_size_); + } + int64_t bytes; + { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + bytes = batch_size_accountant_->HotBytes() + batch_size_accountant_->ColdBytes(); + } + while (bytes + row_batch_size > max_table_size_) { + PX_RETURN_IF_ERROR(ExpireBatch()); + { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + bytes = batch_size_accountant_->HotBytes() + batch_size_accountant_->ColdBytes(); + } + { + absl::base_internal::SpinLockHolder lock(&stats_lock_); + batches_expired_++; + metrics_.batches_expired_counter.Increment(); + } + } + return Status::OK(); + } + + Status WriteHot(internal::RecordOrRowBatch&& record_or_row_batch) { + // See BatchSizeAccountantNonMutableState for an explanation of the thread safety and necessity + // of NonMutableState. + auto batch_stats = internal::BatchSizeAccountant::CalcBatchStats( + ABSL_TS_UNCHECKED_READ(batch_size_accountant_)->NonMutableState(), record_or_row_batch); + + PX_RETURN_IF_ERROR(ExpireRowBatches(batch_stats.bytes)); + + { + absl::base_internal::SpinLockHolder hot_lock(&hot_lock_); + auto batch_length = record_or_row_batch.Length(); + batch_size_accountant_->NewHotBatch(std::move(batch_stats)); + hot_store_->EmplaceBack(next_row_id_, std::move(record_or_row_batch)); + next_row_id_ += batch_length; + } + + { + absl::base_internal::SpinLockHolder lock(&stats_lock_); + ++batches_added_; + metrics_.batches_added_counter.Increment(); + bytes_added_ += batch_stats.bytes; + metrics_.bytes_added_counter.Increment(batch_stats.bytes); + } + + // Make sure locks are released for this call, since they are reacquired inside. + PX_RETURN_IF_ERROR(UpdateTableMetricGauges()); + return Status::OK(); + } + + mutable absl::base_internal::SpinLock hot_lock_; + + TableMetrics metrics_; + + schema::Relation rel_; + + int64_t max_table_size_ = 0; + + int64_t time_col_idx_ = -1; + + mutable absl::base_internal::SpinLock stats_lock_; + int64_t batches_expired_ ABSL_GUARDED_BY(stats_lock_) = 0; + int64_t batches_added_ ABSL_GUARDED_BY(stats_lock_) = 0; + int64_t bytes_added_ ABSL_GUARDED_BY(stats_lock_) = 0; + int64_t compacted_batches_ ABSL_GUARDED_BY(stats_lock_) = 0; + + std::unique_ptr> hot_store_ + ABSL_GUARDED_BY(hot_lock_); + + // Counter to assign a unique row ID to each row. Synchronized by hot_lock_ since its only + // accessed on a hot write. + int64_t next_row_id_ ABSL_GUARDED_BY(hot_lock_) = 0; + + std::unique_ptr batch_size_accountant_ ABSL_GUARDED_BY(hot_lock_); + + friend class Cursor; +}; + /** * Table stores data in two separate partitions, hot and cold. Hot data is "hot" from the * perspective of writes, in other words data is first written to the hot partitiion, and then later @@ -101,7 +411,7 @@ struct TableStats { * that when GetNextRowBatch is called on the cursor it can work out that it needs to return a slice * of the batch with the original "second" batch's data. */ -class Table : public NotCopyable { +class HotColdTable : public Table { using RecordBatchPtr = internal::RecordBatchPtr; using ArrowArrayPtr = internal::ArrowArrayPtr; using ColdBatch = internal::ColdBatch; @@ -111,6 +421,9 @@ class Table : public NotCopyable { using RowIDInterval = internal::RowIDInterval; using BatchID = internal::BatchID; + // TODO(ddelnano): Maybe this should be removed + friend class Cursor; + static inline constexpr int64_t kDefaultColdBatchMinSize = 64 * 1024; public: @@ -120,100 +433,9 @@ class Table : public NotCopyable { const schema::Relation& relation) { // Create naked pointer, because std::make_shared() cannot access the private ctor. return std::shared_ptr
( - new Table(table_name, relation, FLAGS_table_store_table_size_limit)); + new HotColdTable(table_name, relation, FLAGS_table_store_table_size_limit)); } - /** - * Cursor allows iterating the table, while guaranteeing that no row is returned twice (even when - * compactions occur between accesses). {Start,Stop}Spec specify what rows the cursor should begin - * and end at when iterating the cursor. - */ - class Cursor { - public: - /** - * StartSpec defines where a Cursor should begin within the table. Current options are to start - * at a given time, or start at the first row currently in the table. - */ - struct StartSpec { - enum StartType { - StartAtTime, - CurrentStartOfTable, - }; - StartType type = CurrentStartOfTable; - Time start_time = -1; - }; - - /** - * StopSpec defines when a Cursor should stop and be considered exhausted. Current options are - * to stop at a given time, stop at the last row currently in the table, or infinite (i.e. the - * Cursor never becomes exhausted). - */ - struct StopSpec { - enum StopType { - // Iterating a StopAtTime cursor will return all records with `timestamp <= stop_time`. - // The cursor will not be considered `Done()` until a record with `timestamp > stop_time` is - // added to the table. - // Note that StopAtTime is the most expensive of the StopTypes because it requires holding a - // table lock very briefly on each call to `Done()` or `NextBatchReady()` - StopAtTime, - // Iterating a StopAtTimeOrEndOfTable cursor will return all records with `timestamp <= - // stop_time` that existed in the table at the time of cursor creation. The cursor will be - // considered `Done()` once all records with `timestamp <= stop_time` have been consumed or - // when the end of the table is reached (end of the table is determined at cursor creation - // time). - StopAtTimeOrEndOfTable, - // Iterating a CurrentEndOfTable cursor will return all records in the table at cursor - // creation time. - CurrentEndOfTable, - // An Infinite cursor will never be considered `Done()`. - Infinite, - }; - StopType type = CurrentEndOfTable; - // Only valid for StopAtTime or StopAtTimeOrEndOfTable types. - Time stop_time = -1; - }; - - explicit Cursor(const Table* table) : Cursor(table, StartSpec{}, StopSpec{}) {} - Cursor(const Table* table, StartSpec start, StopSpec stop); - - // In the case of StopType == Infinite or StopType == StopAtTime, this returns whether the table - // has the next batch ready. In the case of StopType == CurrentEndOfTable, this returns !Done(). - // Note that `NextBatchReady() == true` doesn't guarantee that `GetNextRowBatch` will succeed. - // For instance, the desired row batch could have been expired between the call to - // `NextBatchReady()` and `GetNextRowBatch(...)`, and then the row batch after the expired one - // is past the stopping condition. In this case `GetNextRowBatch(...)` will return an error. - bool NextBatchReady(); - StatusOr> GetNextRowBatch(const std::vector& cols); - // In the case of StopType == Infinite, this function always returns false. - bool Done(); - // Change the StopSpec of the cursor. - void UpdateStopSpec(StopSpec stop); - - private: - void AdvanceToStart(const StartSpec& start); - void StopStateFromSpec(StopSpec&& stop); - void UpdateStopStateForStopAtTime(); - - // The following methods are made private so that they are only accessible from Table. - internal::RowID* LastReadRowID(); - internal::BatchHints* Hints(); - std::optional StopRowID() const; - - struct StopState { - StopSpec spec; - RowID stop_row_id; - // If StopSpec.type is StopAtTime, then stop_row_id doesn't become finalized until the time is - // within the table. This bool keeps track of when that happens. - bool stop_row_id_final = false; - }; - const Table* table_; - internal::BatchHints hints_; - RowID last_read_row_id_; - StopState stop_; - - friend class Table; - }; - /** * @brief Construct a new Table object along with its columns. Can be used to create * a table (along with columns) based on a subscription message from Stirling. @@ -222,35 +444,35 @@ class Table : public NotCopyable { * @param max_table_size the maximum number of bytes that the table can hold. This is limitless * (-1) by default. */ - explicit Table(std::string_view table_name, const schema::Relation& relation, - size_t max_table_size) - : Table(table_name, relation, max_table_size, kDefaultColdBatchMinSize) {} + explicit HotColdTable(std::string_view table_name, const schema::Relation& relation, + size_t max_table_size) + : HotColdTable(table_name, relation, max_table_size, kDefaultColdBatchMinSize) {} - Table(std::string_view table_name, const schema::Relation& relation, size_t max_table_size, - size_t compacted_batch_size_); + HotColdTable(std::string_view table_name, const schema::Relation& relation, size_t max_table_size, + size_t compacted_batch_size_); /** * Get a RowBatch of data corresponding to the next data after the given cursor. - * @param cursor the Table::Cursor to get the next row batch after. + * @param cursor the Cursor to get the next row batch after. * @param cols a vector of column indices to get data for. * @return a unique ptr to a RowBatch with the requested data. */ StatusOr> GetNextRowBatch( - Cursor* cursor, const std::vector& cols) const; + Cursor* cursor, const std::vector& cols) const override; /** * Get the unique identifier of the first row in the table. * If all the data is expired from the table, this returns the last row id that was in the table. * @return unique identifier of the first row. */ - RowID FirstRowID() const; + RowID FirstRowID() const override; /** * Get the unique identifier of the last row in the table. * If all the data is expired from the table, this returns the last row id that was in the table. * @return unique identifier of the last row. */ - RowID LastRowID() const; + RowID LastRowID() const override; /** * Find the unique identifier of the first row for which its corresponding time is greater than or @@ -258,7 +480,7 @@ class Table : public NotCopyable { * @param time the time to search for. * @return unique identifier of the first row with time greater than or equal to the given time. */ - RowID FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const; + RowID FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const override; /** * Find the unique identifier of the first row for which its corresponding time is greater than @@ -266,13 +488,7 @@ class Table : public NotCopyable { * @param time the time to search for. * @return unique identifier of the first row with time greater than the given time. */ - RowID FindRowIDFromTimeFirstGreaterThan(Time time) const; - - /** - * Writes a row batch to the table. - * @param rb Rowbatch to write to the table. - */ - Status WriteRowBatch(const schema::RowBatch& rb); + RowID FindRowIDFromTimeFirstGreaterThan(Time time) const override; /** * Transfers the given record batch (from Stirling) into the Table. @@ -280,68 +496,139 @@ class Table : public NotCopyable { * @param record_batch the record batch to be appended to the Table. * @return status */ - Status TransferRecordBatch(std::unique_ptr record_batch); - - schema::Relation GetRelation() const; - StatusOr> GetTableAsRecordBatches() const; + /* Status TransferRecordBatch(std::unique_ptr record_batch) + * override; */ /** * Covert the table and store in passed in proto. * @param table_proto The table proto to write to. * @return Status of conversion. */ - Status ToProto(table_store::schemapb::Table* table_proto) const; + Status ToProto(table_store::schemapb::Table* table_proto) const override; - TableStats GetTableStats() const; + TableStats GetTableStats() const override; /** * Compacts hot batches into compacted_batch_size_ sized cold batches. Each call to * CompactHotToCold will create a maximum of kMaxBatchesPerCompactionCall cold batches. * @param mem_pool arrow MemoryPool to be used for creating new cold batches. */ - Status CompactHotToCold(arrow::MemoryPool* mem_pool); + Status CompactHotToCold(arrow::MemoryPool* mem_pool) override; private: - TableMetrics metrics_; + Time MaxTime() const override; - schema::Relation rel_; + Status ExpireBatch() override; + + Status UpdateTableMetricGauges() override; - mutable absl::base_internal::SpinLock stats_lock_; - int64_t batches_expired_ ABSL_GUARDED_BY(stats_lock_) = 0; - int64_t batches_added_ ABSL_GUARDED_BY(stats_lock_) = 0; - int64_t bytes_added_ ABSL_GUARDED_BY(stats_lock_) = 0; - int64_t compacted_batches_ ABSL_GUARDED_BY(stats_lock_) = 0; - int64_t max_table_size_ = 0; const int64_t compacted_batch_size_; - mutable absl::base_internal::SpinLock hot_lock_; - std::unique_ptr> hot_store_ - ABSL_GUARDED_BY(hot_lock_); mutable absl::base_internal::SpinLock cold_lock_; std::unique_ptr> cold_store_ ABSL_GUARDED_BY(cold_lock_); std::deque cold_batch_bytes_ ABSL_GUARDED_BY(cold_lock_); - // Counter to assign a unique row ID to each row. Synchronized by hot_lock_ since its only - // accessed on a hot write. - int64_t next_row_id_ ABSL_GUARDED_BY(hot_lock_) = 0; - int64_t time_col_idx_ = -1; - - Status WriteHot(internal::RecordOrRowBatch&& record_or_row_batch); - - Status ExpireBatch(); - Status ExpireHot(); StatusOr ExpireCold(); - Status ExpireRowBatches(int64_t row_batch_size); Status CompactSingleBatchUnlocked(arrow::MemoryPool* mem_pool) ABSL_EXCLUSIVE_LOCKS_REQUIRED(cold_lock_) ABSL_EXCLUSIVE_LOCKS_REQUIRED(hot_lock_); - Status UpdateTableMetricGauges(); - Time MaxTime() const; + internal::ArrowArrayCompactor compactor_; +}; - std::unique_ptr batch_size_accountant_ ABSL_GUARDED_BY(hot_lock_); +class HotOnlyTable : public Table { + using RowID = internal::RowID; - internal::ArrowArrayCompactor compactor_; + public: + using StopPosition = int64_t; + static inline std::shared_ptr
Create(std::string_view table_name, + const schema::Relation& relation) { + // Create naked pointer, because std::make_shared() cannot access the private ctor. + return std::shared_ptr
( + new HotOnlyTable(table_name, relation, FLAGS_table_store_table_size_limit)); + } + + /** + * @brief Construct a new Table object along with its columns. Can be used to create + * a table (along with columns) based on a subscription message from Stirling. + * + * @param relation the relation for the table. + * @param max_table_size the maximum number of bytes that the table can hold. This is limitless + * (-1) by default. + */ + explicit HotOnlyTable(std::string_view table_name, const schema::Relation& relation, + size_t max_table_size); + + /** + * Get a RowBatch of data corresponding to the next data after the given cursor. + * @param cursor the Cursor to get the next row batch after. + * @param cols a vector of column indices to get data for. + * @return a unique ptr to a RowBatch with the requested data. + */ + StatusOr> GetNextRowBatch( + Cursor* cursor, const std::vector& cols) const override; + + /** + * Get the unique identifier of the first row in the table. + * If all the data is expired from the table, this returns the last row id that was in the table. + * @return unique identifier of the first row. + */ + RowID FirstRowID() const override; + + /** + * Get the unique identifier of the last row in the table. + * If all the data is expired from the table, this returns the last row id that was in the table. + * @return unique identifier of the last row. + */ + RowID LastRowID() const override; + + /** + * Find the unique identifier of the first row for which its corresponding time is greater than or + * equal to the given time. + * @param time the time to search for. + * @return unique identifier of the first row with time greater than or equal to the given time. + */ + RowID FindRowIDFromTimeFirstGreaterThanOrEqual(Time time) const override; + + /** + * Find the unique identifier of the first row for which its corresponding time is greater than + * the given time. + * @param time the time to search for. + * @return unique identifier of the first row with time greater than the given time. + */ + RowID FindRowIDFromTimeFirstGreaterThan(Time time) const override; + + /** + * Transfers the given record batch (from Stirling) into the Table. + * + * @param record_batch the record batch to be appended to the Table. + * @return status + */ + /* Status TransferRecordBatch(std::unique_ptr record_batch) + * override; */ + + /** + * Covert the table and store in passed in proto. + * @param table_proto The table proto to write to. + * @return Status of conversion. + */ + Status ToProto(table_store::schemapb::Table* table_proto) const override; + + TableStats GetTableStats() const override; + + /** + * Compacts hot batches into compacted_batch_size_ sized cold batches. Each call to + * CompactHotToCold will create a maximum of kMaxBatchesPerCompactionCall cold batches. + * @param mem_pool arrow MemoryPool to be used for creating new cold batches. + */ + Status CompactHotToCold(arrow::MemoryPool* mem_pool) override; + + private: + Time MaxTime() const override; + + Status ExpireBatch() override; + + Status UpdateTableMetricGauges() override; friend class Cursor; }; diff --git a/src/table_store/table/table_benchmark.cc b/src/table_store/table/table_benchmark.cc index 8c65271fe2e..22eb1357a16 100644 --- a/src/table_store/table/table_benchmark.cc +++ b/src/table_store/table/table_benchmark.cc @@ -34,7 +34,7 @@ static inline std::unique_ptr
MakeTable(int64_t max_size, int64_t compact schema::Relation rel( std::vector({types::DataType::TIME64NS, types::DataType::FLOAT64}), std::vector({"time_", "float"})); - return std::make_unique
("test_table", rel, max_size, compaction_size); + return std::make_unique("test_table", rel, max_size, compaction_size); } static inline std::unique_ptr MakeHotBatch(int64_t batch_size, @@ -82,7 +82,7 @@ static inline int64_t FillTableCold(Table* table, int64_t table_size, int64_t ba return time_counter; } -static inline void ReadFullTable(Table::Cursor* cursor) { +static inline void ReadFullTable(Cursor* cursor) { while (!cursor->Done()) { benchmark::DoNotOptimize(cursor->GetNextRowBatch({0, 1})); } @@ -98,14 +98,14 @@ static void BM_TableReadAllHot(benchmark::State& state) { CHECK_EQ(table->GetTableStats().bytes, table_size); - Table::Cursor cursor(table.get()); + Cursor cursor(table.get()); for (auto _ : state) { ReadFullTable(&cursor); state.PauseTiming(); table = MakeTable(table_size, compaction_size); FillTableHot(table.get(), table_size, batch_length); - cursor = Table::Cursor(table.get()); + cursor = Cursor(table.get()); state.ResumeTiming(); } @@ -120,25 +120,25 @@ static void BM_TableReadAllCold(benchmark::State& state) { auto table = MakeTable(table_size, compaction_size); FillTableCold(table.get(), table_size, batch_length); CHECK_EQ(table->GetTableStats().bytes, table_size); - Table::Cursor cursor(table.get()); + Cursor cursor(table.get()); for (auto _ : state) { ReadFullTable(&cursor); state.PauseTiming(); - cursor = Table::Cursor(table.get()); + cursor = Cursor(table.get()); state.ResumeTiming(); } state.SetBytesProcessed(state.iterations() * table_size); } -Table::Cursor GetLastBatchCursor(Table* table, int64_t last_time, int64_t batch_length, - const std::vector& cols) { - Table::Cursor cursor(table, - Table::Cursor::StartSpec{Table::Cursor::StartSpec::StartType::StartAtTime, - last_time - 2 * batch_length}, - Table::Cursor::StopSpec{}); +Cursor GetLastBatchCursor(Table* table, int64_t last_time, int64_t batch_length, + const std::vector& cols) { + Cursor cursor( + table, + Cursor::StartSpec{Cursor::StartSpec::StartType::StartAtTime, last_time - 2 * batch_length}, + Cursor::StopSpec{}); // Advance the cursor so that it points to the last batch and has BatchHints set. cursor.GetNextRowBatch(cols); return cursor; @@ -238,7 +238,7 @@ static void BM_TableWriteFull(benchmark::State& state) { // NOLINTNEXTLINE : runtime/references. static void BM_TableCompaction(benchmark::State& state) { int64_t compaction_size = 64 * 1024; - int64_t table_size = Table::kMaxBatchesPerCompactionCall * compaction_size; + int64_t table_size = HotColdTable::kMaxBatchesPerCompactionCall * compaction_size; int64_t batch_length = 256; auto table = MakeTable(table_size, compaction_size); // Fill table first to make sure each compaction hits kMaxBatchesPerCompaction. @@ -254,7 +254,7 @@ static void BM_TableCompaction(benchmark::State& state) { } state.SetBytesProcessed(state.iterations() * compaction_size * - Table::kMaxBatchesPerCompactionCall); + HotColdTable::kMaxBatchesPerCompactionCall); } // NOLINTNEXTLINE : runtime/references. @@ -262,7 +262,7 @@ static void BM_TableThreaded(benchmark::State& state) { schema::Relation rel({types::DataType::TIME64NS}, {"time_"}); schema::RowDescriptor rd({types::DataType::TIME64NS}); std::shared_ptr
table_ptr = - std::make_shared
("test_table", rel, 16 * 1024 * 1024, 5 * 1024); + std::make_shared("test_table", rel, 16 * 1024 * 1024, 5 * 1024); int64_t batch_size = 1024; int64_t num_batches = 16 * 1024; @@ -309,7 +309,7 @@ static void BM_TableThreaded(benchmark::State& state) { int64_t batch_counter = 0; while (batch_counter < (num_batches / num_read_threads)) { - Table::Cursor cursor(table_ptr.get()); + Cursor cursor(table_ptr.get()); auto start = std::chrono::high_resolution_clock::now(); auto batch_or_s = cursor.GetNextRowBatch({0}); auto end = std::chrono::high_resolution_clock::now(); diff --git a/src/table_store/table/table_store.cc b/src/table_store/table/table_store.cc index e7ed6319b87..3bcdacbc69d 100644 --- a/src/table_store/table/table_store.cc +++ b/src/table_store/table/table_store.cc @@ -43,7 +43,7 @@ StatusOr TableStore::CreateNewTablet(uint64_t table_id, const types::Tab const TableInfo& table_info = id_to_table_info_map_iter->second; const schema::Relation& relation = table_info.relation; - std::shared_ptr
new_tablet = Table::Create(table_info.table_name, relation); + std::shared_ptr
new_tablet = HotColdTable::Create(table_info.table_name, relation); TableIDTablet id_key = {table_id, tablet_id}; id_to_table_map_[id_key] = new_tablet; diff --git a/src/table_store/table/table_store_test.cc b/src/table_store/table/table_store_test.cc index 8bd3ca761cc..8e43d3f0fdd 100644 --- a/src/table_store/table/table_store_test.cc +++ b/src/table_store/table/table_store_test.cc @@ -42,8 +42,8 @@ class TableStoreTest : public ::testing::Test { rel2 = schema::Relation({types::DataType::INT64, types::DataType::FLOAT64, types::DataType::INT64}, {"table2col1", "table2col2", "table2col3"}); - table1 = Table::Create("test_table1", rel1); - table2 = Table::Create("test_table2", rel2); + table1 = HotColdTable::Create("test_table1", rel1); + table2 = HotColdTable::Create("test_table2", rel2); } std::unique_ptr MakeRel1ColumnWrapperBatch() { @@ -208,9 +208,9 @@ class TableStoreTabletsTest : public TableStoreTest { protected: void SetUp() override { TableStoreTest::SetUp(); - tablet1_1 = Table::Create("test_table1", rel1); - tablet1_2 = Table::Create("test_table1", rel1); - tablet2_1 = Table::Create("test_table2", rel2); + tablet1_1 = HotColdTable::Create("test_table1", rel1); + tablet1_2 = HotColdTable::Create("test_table1", rel1); + tablet2_1 = HotColdTable::Create("test_table2", rel2); } std::shared_ptr
tablet1_1; diff --git a/src/table_store/table/table_test.cc b/src/table_store/table/table_test.cc index 10d1eed6b44..6a2617098e6 100644 --- a/src/table_store/table/table_test.cc +++ b/src/table_store/table/table_test.cc @@ -37,7 +37,28 @@ namespace { // TOOD(zasgar): deduplicate this with exec/test_utils. std::shared_ptr
TestTable() { schema::Relation rel({types::DataType::FLOAT64, types::DataType::INT64}, {"col1", "col2"}); - auto table = Table::Create("test_table", rel); + auto table = HotColdTable::Create("test_table", rel); + + auto rb1 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 3); + std::vector col1_in1 = {0.5, 1.2, 5.3}; + std::vector col2_in1 = {1, 2, 3}; + PX_CHECK_OK(rb1.AddColumn(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + PX_CHECK_OK(rb1.AddColumn(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + PX_CHECK_OK(table->WriteRowBatch(rb1)); + + auto rb2 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 2); + std::vector col1_in2 = {0.1, 5.1}; + std::vector col2_in2 = {5, 6}; + PX_CHECK_OK(rb2.AddColumn(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + PX_CHECK_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); + PX_CHECK_OK(table->WriteRowBatch(rb2)); + + return table; +} + +std::shared_ptr
HotOnlyTestTable() { + schema::Relation rel({types::DataType::FLOAT64, types::DataType::INT64}, {"col1", "col2"}); + auto table = HotOnlyTable::Create("test_table", rel); auto rb1 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 3); std::vector col1_in1 = {0.5, 1.2, 5.3}; @@ -61,7 +82,42 @@ std::shared_ptr
TestTable() { TEST(TableTest, basic_test) { schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); + Table& table = *table_ptr; + + auto rb1 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 3); + std::vector col1_in1 = {true, false, true}; + std::vector col2_in1 = {1, 2, 3}; + EXPECT_OK(rb1.AddColumn(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + EXPECT_OK(rb1.AddColumn(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + EXPECT_OK(table.WriteRowBatch(rb1)); + + auto rb2 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 2); + std::vector col1_in2 = {false, false}; + std::vector col2_in2 = {5, 6}; + EXPECT_OK(rb2.AddColumn(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + EXPECT_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); + EXPECT_OK(table.WriteRowBatch(rb2)); + + Cursor cursor(table_ptr.get()); + + auto actual_rb1 = cursor.GetNextRowBatch(std::vector({0, 1})).ConsumeValueOrDie(); + EXPECT_TRUE( + actual_rb1->ColumnAt(0)->Equals(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + EXPECT_TRUE( + actual_rb1->ColumnAt(1)->Equals(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + + auto actual_rb2 = cursor.GetNextRowBatch(std::vector({0, 1})).ConsumeValueOrDie(); + EXPECT_TRUE( + actual_rb2->ColumnAt(0)->Equals(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + EXPECT_TRUE( + actual_rb2->ColumnAt(1)->Equals(types::ToArrow(col2_in2, arrow::default_memory_pool()))); +} + +TEST(TableTest, HotOnlyTable_basic_test) { + schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("test_table", rel); Table& table = *table_ptr; auto rb1 = schema::RowBatch(schema::RowDescriptor(rel.col_types()), 3); @@ -78,7 +134,7 @@ TEST(TableTest, basic_test) { EXPECT_OK(rb2.AddColumn(types::ToArrow(col2_in2, arrow::default_memory_pool()))); EXPECT_OK(table.WriteRowBatch(rb2)); - Table::Cursor cursor(table_ptr.get()); + Cursor cursor(table_ptr.get()); auto actual_rb1 = cursor.GetNextRowBatch(std::vector({0, 1})).ConsumeValueOrDie(); EXPECT_TRUE( @@ -97,7 +153,60 @@ TEST(TableTest, bytes_test) { auto rd = schema::RowDescriptor({types::DataType::INT64, types::DataType::STRING}); schema::Relation rel(rd.types(), {"col1", "col2"}); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); + Table& table = *table_ptr; + + schema::RowBatch rb1(rd, 3); + std::vector col1_rb1 = {4, 5, 10}; + std::vector col2_rb1 = {"hello", "abc", "defg"}; + auto col1_rb1_arrow = types::ToArrow(col1_rb1, arrow::default_memory_pool()); + auto col2_rb1_arrow = types::ToArrow(col2_rb1, arrow::default_memory_pool()); + EXPECT_OK(rb1.AddColumn(col1_rb1_arrow)); + EXPECT_OK(rb1.AddColumn(col2_rb1_arrow)); + int64_t rb1_size = 3 * sizeof(int64_t) + 12 * sizeof(char) + 3 * sizeof(uint32_t); + + EXPECT_OK(table.WriteRowBatch(rb1)); + EXPECT_EQ(table.GetTableStats().bytes, rb1_size); + + schema::RowBatch rb2(rd, 2); + std::vector col1_rb2 = {4, 5}; + std::vector col2_rb2 = {"a", "bc"}; + auto col1_rb2_arrow = types::ToArrow(col1_rb2, arrow::default_memory_pool()); + auto col2_rb2_arrow = types::ToArrow(col2_rb2, arrow::default_memory_pool()); + EXPECT_OK(rb2.AddColumn(col1_rb2_arrow)); + EXPECT_OK(rb2.AddColumn(col2_rb2_arrow)); + int64_t rb2_size = 2 * sizeof(int64_t) + 3 * sizeof(char) + 2 * sizeof(uint32_t); + + EXPECT_OK(table.WriteRowBatch(rb2)); + EXPECT_EQ(table.GetTableStats().bytes, rb1_size + rb2_size); + + std::vector time_hot_col1 = {1, 5, 3}; + std::vector time_hot_col2 = {"test", "abc", "de"}; + auto wrapper_batch_1 = std::make_unique(); + auto col_wrapper_1 = std::make_shared(3); + col_wrapper_1->Clear(); + for (const auto& num : time_hot_col1) { + col_wrapper_1->Append(num); + } + auto col_wrapper_2 = std::make_shared(3); + col_wrapper_2->Clear(); + for (const auto& num : time_hot_col2) { + col_wrapper_2->Append(num); + } + wrapper_batch_1->push_back(col_wrapper_1); + wrapper_batch_1->push_back(col_wrapper_2); + int64_t rb3_size = 3 * sizeof(int64_t) + 9 * sizeof(char) + 3 * sizeof(uint32_t); + + EXPECT_OK(table.TransferRecordBatch(std::move(wrapper_batch_1))); + + EXPECT_EQ(table.GetTableStats().bytes, rb1_size + rb2_size + rb3_size); +} + +TEST(TableTest, HotOnlyTable_bytes_test) { + auto rd = schema::RowDescriptor({types::DataType::INT64, types::DataType::STRING}); + schema::Relation rel(rd.types(), {"col1", "col2"}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("test_table", rel); Table& table = *table_ptr; schema::RowBatch rb1(rd, 3); @@ -188,7 +297,7 @@ TEST(TableTest, bytes_test_w_compaction) { // Make minimum batch size rb1_size + rb2_size so that compaction causes 2 of the 3 batches to // be compacted into cold. std::shared_ptr
table_ptr = - std::make_shared
("test_table", rel, 128 * 1024, rb1_size + rb2_size); + std::make_shared("test_table", rel, 128 * 1024, rb1_size + rb2_size); Table& table = *table_ptr; EXPECT_OK(table.WriteRowBatch(rb1)); @@ -208,7 +317,7 @@ TEST(TableTest, expiry_test) { auto rd = schema::RowDescriptor({types::DataType::INT64, types::DataType::STRING}); schema::Relation rel(rd.types(), {"col1", "col2"}); - Table table("test_table", rel, 80); + HotColdTable table("test_table", rel, 80); schema::RowBatch rb1(rd, 3); std::vector col1_rb1 = {4, 5, 10}; @@ -354,7 +463,7 @@ TEST(TableTest, expiry_test_w_compaction) { wrapper_batch_1_2->push_back(col_wrapper_2_2); int64_t rb5_size = 5 * sizeof(int64_t) + 20 * sizeof(char) + 5 * sizeof(uint32_t); - Table table("test_table", rel, 80, 40); + HotColdTable table("test_table", rel, 80, 40); EXPECT_OK(table.WriteRowBatch(rb1)); EXPECT_EQ(table.GetTableStats().bytes, rb1_size); @@ -376,7 +485,7 @@ TEST(TableTest, batch_size_too_big) { auto rd = schema::RowDescriptor({types::DataType::INT64, types::DataType::STRING}); schema::Relation rel(rd.types(), {"col1", "col2"}); - Table table("test_table", rel, 10); + HotColdTable table("test_table", rel, 10); schema::RowBatch rb1(rd, 3); std::vector col1_rb1 = {4, 5, 10}; @@ -394,7 +503,7 @@ TEST(TableTest, write_row_batch) { auto rd = schema::RowDescriptor({types::DataType::BOOLEAN, types::DataType::INT64}); schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); Table& table = *table_ptr; schema::RowBatch rb1(rd, 2); @@ -407,7 +516,32 @@ TEST(TableTest, write_row_batch) { EXPECT_OK(table.WriteRowBatch(rb1)); - Table::Cursor cursor(table_ptr.get()); + Cursor cursor(table_ptr.get()); + auto rb_or_s = cursor.GetNextRowBatch({0, 1}); + ASSERT_OK(rb_or_s); + auto actual_rb = rb_or_s.ConsumeValueOrDie(); + EXPECT_TRUE(actual_rb->ColumnAt(0)->Equals(col1_rb1_arrow)); + EXPECT_TRUE(actual_rb->ColumnAt(1)->Equals(col2_rb1_arrow)); +} + +TEST(TableTest, HotOnlyTable_write_row_batch) { + auto rd = schema::RowDescriptor({types::DataType::BOOLEAN, types::DataType::INT64}); + schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("test_table", rel); + Table& table = *table_ptr; + + schema::RowBatch rb1(rd, 2); + std::vector col1_rb1 = {true, false}; + std::vector col2_rb1 = {1, 2}; + auto col1_rb1_arrow = types::ToArrow(col1_rb1, arrow::default_memory_pool()); + auto col2_rb1_arrow = types::ToArrow(col2_rb1, arrow::default_memory_pool()); + EXPECT_OK(rb1.AddColumn(col1_rb1_arrow)); + EXPECT_OK(rb1.AddColumn(col2_rb1_arrow)); + + EXPECT_OK(table.WriteRowBatch(rb1)); + + Cursor cursor(table_ptr.get()); auto rb_or_s = cursor.GetNextRowBatch({0, 1}); ASSERT_OK(rb_or_s); auto actual_rb = rb_or_s.ConsumeValueOrDie(); @@ -418,7 +552,48 @@ TEST(TableTest, write_row_batch) { TEST(TableTest, hot_batches_test) { schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); - std::shared_ptr
table_ptr = Table::Create("table_name", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("table_name", rel); + Table& table = *table_ptr; + + std::vector col1_in1 = {true, false, true}; + auto col1_in1_wrapper = + types::ColumnWrapper::FromArrow(types::ToArrow(col1_in1, arrow::default_memory_pool())); + std::vector col1_in2 = {false, false}; + auto col1_in2_wrapper = + types::ColumnWrapper::FromArrow(types::ToArrow(col1_in2, arrow::default_memory_pool())); + + std::vector col2_in1 = {1, 2, 3}; + auto col2_in1_wrapper = + types::ColumnWrapper::FromArrow(types::ToArrow(col2_in1, arrow::default_memory_pool())); + std::vector col2_in2 = {5, 6}; + auto col2_in2_wrapper = + types::ColumnWrapper::FromArrow(types::ToArrow(col2_in2, arrow::default_memory_pool())); + + auto rb_wrapper_1 = std::make_unique(); + rb_wrapper_1->push_back(col1_in1_wrapper); + rb_wrapper_1->push_back(col2_in1_wrapper); + EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_1))); + + auto rb_wrapper_2 = std::make_unique(); + rb_wrapper_2->push_back(col1_in2_wrapper); + rb_wrapper_2->push_back(col2_in2_wrapper); + EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_2))); + + Cursor cursor(table_ptr.get()); + auto rb1 = cursor.GetNextRowBatch({0, 1}).ConsumeValueOrDie(); + EXPECT_TRUE(rb1->ColumnAt(0)->Equals(types::ToArrow(col1_in1, arrow::default_memory_pool()))); + EXPECT_TRUE(rb1->ColumnAt(1)->Equals(types::ToArrow(col2_in1, arrow::default_memory_pool()))); + + auto rb2 = cursor.GetNextRowBatch({0, 1}).ConsumeValueOrDie(); + ASSERT_NE(rb2, nullptr); + EXPECT_TRUE(rb2->ColumnAt(0)->Equals(types::ToArrow(col1_in2, arrow::default_memory_pool()))); + EXPECT_TRUE(rb2->ColumnAt(1)->Equals(types::ToArrow(col2_in2, arrow::default_memory_pool()))); +} + +TEST(TableTest, HotOnlyTable_hot_batches_test) { + schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("table_name", rel); Table& table = *table_ptr; std::vector col1_in1 = {true, false, true}; @@ -445,7 +620,7 @@ TEST(TableTest, hot_batches_test) { rb_wrapper_2->push_back(col2_in2_wrapper); EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_2))); - Table::Cursor cursor(table_ptr.get()); + Cursor cursor(table_ptr.get()); auto rb1 = cursor.GetNextRowBatch({0, 1}).ConsumeValueOrDie(); EXPECT_TRUE(rb1->ColumnAt(0)->Equals(types::ToArrow(col1_in1, arrow::default_memory_pool()))); EXPECT_TRUE(rb1->ColumnAt(1)->Equals(types::ToArrow(col2_in1, arrow::default_memory_pool()))); @@ -482,12 +657,12 @@ TEST(TableTest, hot_batches_w_compaction_test) { rb_wrapper_2->push_back(col1_in2_wrapper); rb_wrapper_2->push_back(col2_in2_wrapper); - Table table("test_table", rel, 128 * 1024, rb1_size); + HotColdTable table("test_table", rel, 128 * 1024, rb1_size); EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_1))); EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_2))); - Table::Cursor cursor(&table); + Cursor cursor(&table); auto rb1 = cursor.GetNextRowBatch({0, 1}).ConsumeValueOrDie(); EXPECT_TRUE(rb1->ColumnAt(0)->Equals(types::ToArrow(col1_in1, arrow::default_memory_pool()))); EXPECT_TRUE(rb1->ColumnAt(1)->Equals(types::ToArrow(col2_in1, arrow::default_memory_pool()))); @@ -502,7 +677,7 @@ TEST(TableTest, hot_batches_w_compaction_test) { TEST(TableTest, find_rowid_from_time_first_greater_than_or_equal) { schema::Relation rel(std::vector({types::DataType::TIME64NS}), std::vector({"time_"})); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); Table& table = *table_ptr; std::vector time_batch_1 = {2, 3, 4, 6}; @@ -579,7 +754,7 @@ TEST(TableTest, find_rowid_from_time_first_greater_than_or_equal_with_compaction schema::Relation rel(std::vector({types::DataType::TIME64NS}), std::vector({"time_"})); int64_t compaction_size = 4 * sizeof(int64_t); - Table table("test_table", rel, 128 * 1024, compaction_size); + HotColdTable table("test_table", rel, 128 * 1024, compaction_size); std::vector time_batch_1 = {2, 3, 4, 6}; std::vector time_batch_2 = {8, 8, 8}; @@ -717,11 +892,96 @@ TEST(TableTest, ToProto) { EXPECT_TRUE(differ.Compare(expected_proto, table_proto)); } +// TODO(ddelnano): Not sure if this matters since I believe StopSpec::Inifinite will hit +// an error for this ToProto test. +TEST(TableTest, DISABLED_HotOnlyTable_ToProto) { + auto table = HotOnlyTestTable(); + table_store::schemapb::Table table_proto; + EXPECT_OK(table->ToProto(&table_proto)); + + std::string expected = R"( + relation { + columns { + column_name: "col1" + column_type: FLOAT64 + column_semantic_type: ST_NONE + } + columns { + column_name: "col2" + column_type: INT64 + column_semantic_type: ST_NONE + } + } + row_batches { + cols { + float64_data { + data: 0.5 + data: 1.2 + data: 5.3 + } + } + cols { + int64_data { + data: 1 + data: 2 + data: 3 + } + } + eow: false + eos: false + num_rows: 3 + } + row_batches { + cols { + float64_data { + data: 0.1 + data: 5.1 + } + } + cols { + int64_data { + data: 5 + data: 6 + } + } + eow: true + eos: true + num_rows: 2 + })"; + + google::protobuf::util::MessageDifferencer differ; + table_store::schemapb::Table expected_proto; + ASSERT_TRUE(google::protobuf::TextFormat::MergeFromString(expected, &expected_proto)); + EXPECT_TRUE(differ.Compare(expected_proto, table_proto)); +} + TEST(TableTest, transfer_empty_record_batch_test) { schema::Relation rel({types::DataType::INT64}, {"col1"}); schema::RowDescriptor rd({types::DataType::INT64}); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); + Table& table = *table_ptr; + + // ColumnWrapper with no columns should not be added to row batches. + auto wrapper_batch_1 = std::make_unique(); + EXPECT_OK(table.TransferRecordBatch(std::move(wrapper_batch_1))); + + EXPECT_EQ(table.GetTableStats().batches_added, 0); + + // Column wrapper with empty columns should not be added to row batches. + auto wrapper_batch_2 = std::make_unique(); + auto col_wrapper_2 = std::make_shared(0); + wrapper_batch_2->push_back(col_wrapper_2); + EXPECT_OK(table.TransferRecordBatch(std::move(wrapper_batch_2))); + + EXPECT_EQ(table.GetTableStats().batches_added, 0); +} + +TEST(TableTest, HotOnlyTable_transfer_empty_record_batch_test) { + schema::Relation rel({types::DataType::INT64}, {"col1"}); + schema::RowDescriptor rd({types::DataType::INT64}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("test_table", rel); Table& table = *table_ptr; // ColumnWrapper with no columns should not be added to row batches. @@ -743,7 +1003,22 @@ TEST(TableTest, write_zero_row_row_batch) { schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); schema::RowDescriptor rd({types::DataType::BOOLEAN, types::DataType::INT64}); - std::shared_ptr
table_ptr = Table::Create("test_table", rel); + std::shared_ptr
table_ptr = HotColdTable::Create("test_table", rel); + + auto result = schema::RowBatch::WithZeroRows(rd, /*eow*/ false, /*eos*/ false); + ASSERT_OK(result); + auto rb_ptr = result.ConsumeValueOrDie(); + + EXPECT_OK(table_ptr->WriteRowBatch(*rb_ptr)); + // Row batch with 0 rows won't be written. + EXPECT_EQ(table_ptr->GetTableStats().batches_added, 0); +} + +TEST(TableTest, HotOnlyTable_write_zero_row_row_batch) { + schema::Relation rel({types::DataType::BOOLEAN, types::DataType::INT64}, {"col1", "col2"}); + schema::RowDescriptor rd({types::DataType::BOOLEAN, types::DataType::INT64}); + + std::shared_ptr
table_ptr = HotOnlyTable::Create("test_table", rel); auto result = schema::RowBatch::WithZeroRows(rd, /*eow*/ false, /*eos*/ false); ASSERT_OK(result); @@ -771,7 +1046,7 @@ TEST(TableTest, threaded) { schema::Relation rel({types::DataType::TIME64NS}, {"time_"}); schema::RowDescriptor rd({types::DataType::TIME64NS}); std::shared_ptr
table_ptr = - std::make_shared
("test_table", rel, 8 * 1024 * 1024, 5 * 1024); + std::make_shared("test_table", rel, 8 * 1024 * 1024, 5 * 1024); int64_t max_time_counter = 1024 * 1024; @@ -786,8 +1061,8 @@ TEST(TableTest, threaded) { }); // Create the cursor before the write thread starts, to ensure that we get every row of the table. - Table::Cursor cursor(table_ptr.get(), Table::Cursor::StartSpec{}, - Table::Cursor::StopSpec{Table::Cursor::StopSpec::StopType::Infinite}); + Cursor cursor(table_ptr.get(), Cursor::StartSpec{}, + Cursor::StopSpec{Cursor::StopSpec::StopType::Infinite}); std::thread writer_thread([table_ptr, done, max_time_counter]() { std::default_random_engine gen; @@ -844,7 +1119,7 @@ TEST(TableTest, threaded) { } // Now that the writer is finished move the stop of the cursor to the current end of the table. - cursor.UpdateStopSpec(Table::Cursor::StopSpec{Table::Cursor::StopSpec::CurrentEndOfTable}); + cursor.UpdateStopSpec(Cursor::StopSpec{Cursor::StopSpec::CurrentEndOfTable}); // Once the writer is finished, we loop over the remaining data in the table. while (time_counter < max_time_counter && !cursor.Done()) { @@ -872,7 +1147,7 @@ TEST(TableTest, NextBatch_generation_bug) { schema::Relation rel(rd.types(), {"col1", "col2"}); int64_t rb1_size = 3 * sizeof(int64_t) + 12 * sizeof(char) + 3 * sizeof(uint32_t); - Table table("test_table", rel, rb1_size, rb1_size); + HotColdTable table("test_table", rel, rb1_size, rb1_size); schema::RowBatch rb1(rd, 3); std::vector col1_rb1 = {4, 5, 10}; @@ -885,7 +1160,7 @@ TEST(TableTest, NextBatch_generation_bug) { EXPECT_OK(table.WriteRowBatch(rb1)); EXPECT_OK(table.CompactHotToCold(arrow::default_memory_pool())); - Table::Cursor cursor(&table, Table::Cursor::StartSpec{}, Table::Cursor::StopSpec{}); + Cursor cursor(&table, Cursor::StartSpec{}, Cursor::StopSpec{}); // Force cold expiration. EXPECT_OK(table.WriteRowBatch(rb1)); // GetNextRowBatch should return invalidargument since the batch was expired. @@ -919,12 +1194,12 @@ TEST(TableTest, GetNextRowBatch_after_expiry) { rb_wrapper_2->push_back(col2_in2_wrapper); int64_t rb2_size = 2 * sizeof(bool) + 2 * sizeof(int64_t); - Table table("test_table", rel, rb1_size + rb2_size, rb1_size); + HotColdTable table("test_table", rel, rb1_size + rb2_size, rb1_size); EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_1))); EXPECT_OK(table.TransferRecordBatch(std::move(rb_wrapper_2))); - Table::Cursor cursor(&table); + Cursor cursor(&table); // This write will expire the first batch. auto rb_wrapper_1_copy = std::make_unique(); @@ -942,8 +1217,8 @@ TEST(TableTest, GetNextRowBatch_after_expiry) { struct CursorTestCase { std::string name; std::vector> initial_time_batches; - Table::Cursor::StartSpec start_spec; - Table::Cursor::StopSpec stop_spec; + Cursor::StartSpec start_spec; + Cursor::StopSpec stop_spec; struct Action { enum ActionType { ExpectBatch, @@ -965,14 +1240,14 @@ class CursorTableTest : public ::testing::Test, rel_ = std::make_unique(std::vector{types::TIME64NS}, std::vector{"time_"}); - table_ptr_ = Table::Create("test_table", *rel_); + table_ptr_ = HotColdTable::Create("test_table", *rel_); for (const auto& batch : test_case_.initial_time_batches) { WriteBatch(batch); } - cursor_ = std::make_unique(table_ptr_.get(), test_case_.start_spec, - test_case_.stop_spec); + cursor_ = + std::make_unique(table_ptr_.get(), test_case_.start_spec, test_case_.stop_spec); } void WriteBatch(const std::vector& times) { @@ -1002,7 +1277,7 @@ class CursorTableTest : public ::testing::Test, CursorTestCase test_case_; std::unique_ptr rel_; std::shared_ptr
table_ptr_; - std::unique_ptr cursor_; + std::unique_ptr cursor_; }; TEST_P(CursorTableTest, cursor_test) { @@ -1021,8 +1296,8 @@ TEST_P(CursorTableTest, cursor_test) { } } -using StartType = Table::Cursor::StartSpec::StartType; -using StopType = Table::Cursor::StopSpec::StopType; +using StartType = Cursor::StartSpec::StartType; +using StopType = Cursor::StopSpec::StopType; INSTANTIATE_TEST_SUITE_P(CursorTableTestSuite, CursorTableTest, ::testing::ValuesIn(std::vector{ diff --git a/src/table_store/table/tablets_group.cc b/src/table_store/table/tablets_group.cc index adf6e0f961a..9c35d0a9bbb 100644 --- a/src/table_store/table/tablets_group.cc +++ b/src/table_store/table/tablets_group.cc @@ -24,7 +24,7 @@ namespace table_store { void TabletsGroup::CreateTablet(const types::TabletID& tablet_id) { LOG_IF(DFATAL, HasTablet(tablet_id)) << absl::Substitute("Tablet with id $0 already exists in Table.", tablet_id); - tablet_id_to_tablet_map_[tablet_id] = Table::Create(tablet_id, relation_); + tablet_id_to_tablet_map_[tablet_id] = HotColdTable::Create(tablet_id, relation_); } void TabletsGroup::AddTablet(const types::TabletID& tablet_id, std::shared_ptr
tablet) { diff --git a/src/table_store/table/tablets_group_test.cc b/src/table_store/table/tablets_group_test.cc index a9ec26ba7da..6d34aac5637 100644 --- a/src/table_store/table/tablets_group_test.cc +++ b/src/table_store/table/tablets_group_test.cc @@ -40,8 +40,8 @@ class TabletsGroupTest : public ::testing::Test { rel2 = schema::Relation({types::DataType::INT64, types::DataType::FLOAT64, types::DataType::INT64}, {"table2col1", "table2col2", "table2col3"}); - tablet1 = Table::Create("test_table1", rel1); - tablet2 = Table::Create("test_table2", rel2); + tablet1 = HotColdTable::Create("test_table1", rel1); + tablet2 = HotColdTable::Create("test_table2", rel2); } std::shared_ptr
tablet1; diff --git a/src/table_store/test_utils.h b/src/table_store/test_utils.h index ae524c612e0..2f4bc35ab4b 100644 --- a/src/table_store/test_utils.h +++ b/src/table_store/test_utils.h @@ -61,7 +61,7 @@ inline StatusOr> CreateTable( const datagen::DistributionParams* dist_vars, const datagen::DistributionParams* len_vars) { schema::RowDescriptor rd(types); - auto table = Table::Create("test_table", table_store::schema::Relation(types, col_names)); + auto table = HotColdTable::Create("test_table", table_store::schema::Relation(types, col_names)); for (int batch_idx = 0; batch_idx < num_batches; batch_idx++) { auto rb = schema::RowBatch(schema::RowDescriptor(types), rb_size); diff --git a/src/ui/src/utils/pxl.ts b/src/ui/src/utils/pxl.ts index ba44b9e4ac5..cc07e2c06bd 100644 --- a/src/ui/src/utils/pxl.ts +++ b/src/ui/src/utils/pxl.ts @@ -20,6 +20,8 @@ const pxlMutations = [ 'from pxtrace', 'import pxtrace', + 'from pxlog', + 'import pxlog', 'import pxconfig', ]; diff --git a/src/vizier/funcs/context/vizier_context.h b/src/vizier/funcs/context/vizier_context.h index a431c4cdd12..6820ac738f3 100644 --- a/src/vizier/funcs/context/vizier_context.h +++ b/src/vizier/funcs/context/vizier_context.h @@ -42,17 +42,19 @@ class VizierFuncFactoryContext : public NotCopyable { public: using MDSStub = services::metadata::MetadataService::Stub; using MDTPStub = services::metadata::MetadataTracepointService::Stub; + using MDFSStub = services::metadata::MetadataFileSourceService::Stub; VizierFuncFactoryContext() = default; VizierFuncFactoryContext( const agent::BaseManager* agent_manager, const std::shared_ptr& mds_stub, - const std::shared_ptr& mdtp_stub, + const std::shared_ptr& mdtp_stub, const std::shared_ptr& mdfs_stub, const std::shared_ptr& cronscript_stub, std::shared_ptr<::px::table_store::TableStore> table_store, std::function add_grpc_auth) : agent_manager_(agent_manager), mds_stub_(mds_stub), mdtp_stub_(mdtp_stub), + mdfs_stub_(mdfs_stub), cronscript_stub_(cronscript_stub), table_store_(table_store), add_auth_to_grpc_context_func_(add_grpc_auth) {} @@ -72,6 +74,10 @@ class VizierFuncFactoryContext : public NotCopyable { CHECK(mdtp_stub_ != nullptr); return mdtp_stub_; } + std::shared_ptr mdfs_stub() const { + CHECK(mdfs_stub_ != nullptr); + return mdfs_stub_; + } std::shared_ptr cronscript_stub() const { CHECK(cronscript_stub_ != nullptr); return cronscript_stub_; @@ -88,6 +94,7 @@ class VizierFuncFactoryContext : public NotCopyable { const agent::BaseManager* agent_manager_ = nullptr; std::shared_ptr mds_stub_ = nullptr; std::shared_ptr mdtp_stub_ = nullptr; + std::shared_ptr mdfs_stub_ = nullptr; std::shared_ptr cronscript_stub_ = nullptr; std::shared_ptr<::px::table_store::TableStore> table_store_ = nullptr; std::function add_auth_to_grpc_context_func_; diff --git a/src/vizier/funcs/md_udtfs/md_udtfs.cc b/src/vizier/funcs/md_udtfs/md_udtfs.cc index 193c6d45dff..9ebc5c75eed 100644 --- a/src/vizier/funcs/md_udtfs/md_udtfs.cc +++ b/src/vizier/funcs/md_udtfs/md_udtfs.cc @@ -55,6 +55,8 @@ void RegisterFuncsOrDie(const VizierFuncFactoryContext& ctx, carnot::udf::Regist registry->RegisterFactoryOrDie>( "GetTracepointStatus", ctx); + registry->RegisterFactoryOrDie>( + "GetFileSourceStatus", ctx); registry ->RegisterFactoryOrDie>( "GetCronScriptHistory", ctx); diff --git a/src/vizier/funcs/md_udtfs/md_udtfs_impl.h b/src/vizier/funcs/md_udtfs/md_udtfs_impl.h index e48dd4ce790..55bc5492d0f 100644 --- a/src/vizier/funcs/md_udtfs/md_udtfs_impl.h +++ b/src/vizier/funcs/md_udtfs/md_udtfs_impl.h @@ -75,6 +75,20 @@ class UDTFWithMDTPFactory : public carnot::udf::UDTFFactory { const VizierFuncFactoryContext& ctx_; }; +template +class UDTFWithMDFSFactory : public carnot::udf::UDTFFactory { + public: + UDTFWithMDFSFactory() = delete; + explicit UDTFWithMDFSFactory(const VizierFuncFactoryContext& ctx) : ctx_(ctx) {} + + std::unique_ptr Make() override { + return std::make_unique(ctx_.mdfs_stub(), ctx_.add_auth_to_grpc_context_func()); + } + + private: + const VizierFuncFactoryContext& ctx_; +}; + template class UDTFWithCronscriptFactory : public carnot::udf::UDTFFactory { public: @@ -136,7 +150,9 @@ class GetTables final : public carnot::udf::UDTF { return MakeArray(ColInfo("table_name", types::DataType::STRING, types::PatternType::GENERAL, "The table name"), ColInfo("table_desc", types::DataType::STRING, types::PatternType::GENERAL, - "Description of the table")); + "Description of the table"), + ColInfo("table_metadata", types::DataType::STRING, types::PatternType::GENERAL, + "Metadata of the table in JSON")); } Status Init(FunctionContext*) { @@ -151,7 +167,7 @@ class GetTables final : public carnot::udf::UDTF { } for (const auto& [table_name, rel] : resp.schema().relation_map()) { - table_info_.emplace_back(table_name, rel.desc()); + table_info_.emplace_back(table_name, rel.desc(), rel.mutation_id()); } return Status::OK(); } @@ -163,6 +179,7 @@ class GetTables final : public carnot::udf::UDTF { const auto& r = table_info_[idx_]; rw->Append(r.table_name); rw->Append(r.table_desc); + rw->Append(r.table_metadata); idx_++; return idx_ < static_cast(table_info_.size()); @@ -170,10 +187,12 @@ class GetTables final : public carnot::udf::UDTF { private: struct TableInfo { - TableInfo(const std::string& table_name, const std::string& table_desc) - : table_name(table_name), table_desc(table_desc) {} + TableInfo(const std::string& table_name, const std::string& table_desc, + const std::string& table_metadata) + : table_name(table_name), table_desc(table_desc), table_metadata(table_metadata) {} std::string table_name; std::string table_desc; + std::string table_metadata; }; int idx_ = 0; @@ -880,6 +899,8 @@ class GetTracepointStatus final : public carnot::udf::UDTF static constexpr auto OutputRelation() { return MakeArray(ColInfo("tracepoint_id", types::DataType::UINT128, types::PatternType::GENERAL, "The id of the tracepoint"), + ColInfo("tracepoint_id_str", types::DataType::STRING, types::PatternType::GENERAL, + "The string id of the tracepoint"), ColInfo("name", types::DataType::STRING, types::PatternType::GENERAL, "The name of the tracepoint"), ColInfo("state", types::DataType::STRING, types::PatternType::GENERAL, @@ -958,6 +979,7 @@ class GetTracepointStatus final : public carnot::udf::UDTF tables.Accept(tables_writer); rw->Append(absl::MakeUint128(u.ab, u.cd)); + rw->Append(u.str()); rw->Append(tracepoint_info.name()); rw->Append(state); @@ -984,6 +1006,130 @@ class GetTracepointStatus final : public carnot::udf::UDTF std::function add_context_authentication_func_; }; +/** + * This UDTF fetches information about tracepoints from MDS. + */ +class GetFileSourceStatus final : public carnot::udf::UDTF { + public: + using MDFSStub = vizier::services::metadata::MetadataFileSourceService::Stub; + using FileSourceResponse = vizier::services::metadata::GetFileSourceInfoResponse; + GetFileSourceStatus() = delete; + explicit GetFileSourceStatus(std::shared_ptr stub, + std::function add_context_authentication) + : idx_(0), stub_(stub), add_context_authentication_func_(add_context_authentication) {} + + static constexpr auto Executor() { return carnot::udfspb::UDTFSourceExecutor::UDTF_ONE_KELVIN; } + + static constexpr auto OutputRelation() { + // TODO(ddelnano): Change the file_source_id column to a UINT128 once the pxl lookup from + // px/pipeline_flow_graph works. That script has a UINT128 stored as a string and needs to + // be joined with this column + return MakeArray(ColInfo("file_source_id", types::DataType::STRING, + types::PatternType::GENERAL, "The id of the file source"), + ColInfo("name", types::DataType::STRING, types::PatternType::GENERAL, + "The name of the file source"), + ColInfo("state", types::DataType::STRING, types::PatternType::GENERAL, + "The state of the file source"), + ColInfo("status", types::DataType::STRING, types::PatternType::GENERAL, + "The status message if not healthy"), + ColInfo("output_tables", types::DataType::STRING, types::PatternType::GENERAL, + "A list of tables output by the file source")); + // TODO(ddelnano): Add in the create time, and TTL in here after we add those attributes to the + // GetFileSourceInfo RPC call in MDS. + } + + Status Init(FunctionContext*) { + px::vizier::services::metadata::GetFileSourceInfoRequest req; + resp_ = std::make_unique(); + + grpc::ClientContext ctx; + add_context_authentication_func_(&ctx); + auto s = stub_->GetFileSourceInfo(&ctx, req, resp_.get()); + if (!s.ok()) { + return error::Internal("Failed to make RPC call to GetFileSourceStatus: $0", + s.error_message()); + } + return Status::OK(); + } + + bool NextRecord(FunctionContext*, RecordWriter* rw) { + if (resp_->file_sources_size() == 0) { + return false; + } + const auto& file_source_info = resp_->file_sources(idx_); + + auto u_or_s = ParseUUID(file_source_info.id()); + sole::uuid u; + if (u_or_s.ok()) { + u = u_or_s.ConsumeValueOrDie(); + } + + auto actual = file_source_info.state(); + auto expected = file_source_info.expected_state(); + std::string state; + + switch (actual) { + case statuspb::PENDING_STATE: { + state = "pending"; + break; + } + case statuspb::RUNNING_STATE: { + state = "running"; + break; + } + case statuspb::FAILED_STATE: { + state = "failed"; + break; + } + case statuspb::TERMINATED_STATE: { + if (actual != expected) { + state = "terminating"; + } else { + state = "terminated"; + } + break; + } + default: + state = "unknown"; + } + + rapidjson::Document tables; + tables.SetArray(); + for (const auto& table : file_source_info.schema_names()) { + tables.PushBack(internal::StringRef(table), tables.GetAllocator()); + } + + rapidjson::StringBuffer tables_sb; + rapidjson::Writer tables_writer(tables_sb); + tables.Accept(tables_writer); + + rw->Append(u.str()); + rw->Append(file_source_info.name()); + rw->Append(state); + + rapidjson::Document statuses; + statuses.SetArray(); + for (const auto& status : file_source_info.statuses()) { + statuses.PushBack(internal::StringRef(status.msg()), statuses.GetAllocator()); + } + rapidjson::StringBuffer statuses_sb; + rapidjson::Writer statuses_writer(statuses_sb); + statuses.Accept(statuses_writer); + rw->Append(statuses_sb.GetString()); + + rw->Append(tables_sb.GetString()); + + ++idx_; + return idx_ < resp_->file_sources_size(); + } + + private: + int idx_ = 0; + std::unique_ptr resp_; + std::shared_ptr stub_; + std::function add_context_authentication_func_; +}; + class GetCronScriptHistory final : public carnot::udf::UDTF { public: using CronScriptStoreStub = vizier::services::metadata::CronScriptStoreService::Stub; diff --git a/src/vizier/messages/messagespb/BUILD.bazel b/src/vizier/messages/messagespb/BUILD.bazel index 5be2739d0dc..902b666b693 100644 --- a/src/vizier/messages/messagespb/BUILD.bazel +++ b/src/vizier/messages/messagespb/BUILD.bazel @@ -24,6 +24,7 @@ pl_proto_library( "//src/api/proto/uuidpb:uuid_pl_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_proto", + "//src/carnot/planner/file_source/ir:logical_pl_proto", "//src/carnot/planpb:plan_pl_proto", "//src/common/base/statuspb:status_pl_proto", "//src/shared/bloomfilterpb:bloomfilter_pl_proto", @@ -44,6 +45,7 @@ pl_cc_proto_library( "//src/api/proto/uuidpb:uuid_pl_cc_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_cc_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_cc_proto", + "//src/carnot/planner/file_source/ir:logical_pl_cc_proto", "//src/carnot/planpb:plan_pl_cc_proto", "//src/common/base/statuspb:status_pl_cc_proto", "//src/shared/bloomfilterpb:bloomfilter_pl_cc_proto", @@ -65,6 +67,7 @@ pl_go_proto_library( "//src/api/proto/uuidpb:uuid_pl_go_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_go_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", "//src/carnot/planpb:plan_pl_go_proto", "//src/common/base/statuspb:status_pl_go_proto", "//src/shared/bloomfilterpb:bloomfilter_pl_go_proto", diff --git a/src/vizier/messages/messagespb/messages.pb.go b/src/vizier/messages/messagespb/messages.pb.go index 02713a1d90b..f2b36a62af1 100755 --- a/src/vizier/messages/messagespb/messages.pb.go +++ b/src/vizier/messages/messagespb/messages.pb.go @@ -13,6 +13,7 @@ import ( uuidpb "px.dev/pixie/src/api/proto/uuidpb" distributedpb "px.dev/pixie/src/carnot/planner/distributedpb" logicalpb "px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb" + ir "px.dev/pixie/src/carnot/planner/file_source/ir" planpb "px.dev/pixie/src/carnot/planpb" statuspb "px.dev/pixie/src/common/base/statuspb" metadatapb "px.dev/pixie/src/shared/k8s/metadatapb" @@ -44,6 +45,7 @@ type VizierMessage struct { // *VizierMessage_TracepointMessage // *VizierMessage_ConfigUpdateMessage // *VizierMessage_K8SMetadataMessage + // *VizierMessage_FileSourceMessage Msg isVizierMessage_Msg `protobuf_oneof:"msg"` } @@ -113,6 +115,9 @@ type VizierMessage_ConfigUpdateMessage struct { type VizierMessage_K8SMetadataMessage struct { K8SMetadataMessage *K8SMetadataMessage `protobuf:"bytes,12,opt,name=k8s_metadata_message,json=k8sMetadataMessage,proto3,oneof" json:"k8s_metadata_message,omitempty"` } +type VizierMessage_FileSourceMessage struct { + FileSourceMessage *FileSourceMessage `protobuf:"bytes,13,opt,name=file_source_message,json=fileSourceMessage,proto3,oneof" json:"file_source_message,omitempty"` +} func (*VizierMessage_RegisterAgentRequest) isVizierMessage_Msg() {} func (*VizierMessage_RegisterAgentResponse) isVizierMessage_Msg() {} @@ -123,6 +128,7 @@ func (*VizierMessage_ExecuteQueryRequest) isVizierMessage_Msg() {} func (*VizierMessage_TracepointMessage) isVizierMessage_Msg() {} func (*VizierMessage_ConfigUpdateMessage) isVizierMessage_Msg() {} func (*VizierMessage_K8SMetadataMessage) isVizierMessage_Msg() {} +func (*VizierMessage_FileSourceMessage) isVizierMessage_Msg() {} func (m *VizierMessage) GetMsg() isVizierMessage_Msg { if m != nil { @@ -194,6 +200,13 @@ func (m *VizierMessage) GetK8SMetadataMessage() *K8SMetadataMessage { return nil } +func (m *VizierMessage) GetFileSourceMessage() *FileSourceMessage { + if x, ok := m.GetMsg().(*VizierMessage_FileSourceMessage); ok { + return x.FileSourceMessage + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*VizierMessage) XXX_OneofWrappers() []interface{} { return []interface{}{ @@ -206,6 +219,7 @@ func (*VizierMessage) XXX_OneofWrappers() []interface{} { (*VizierMessage_TracepointMessage)(nil), (*VizierMessage_ConfigUpdateMessage)(nil), (*VizierMessage_K8SMetadataMessage)(nil), + (*VizierMessage_FileSourceMessage)(nil), } } @@ -307,6 +321,104 @@ func (*TracepointMessage) XXX_OneofWrappers() []interface{} { } } +type FileSourceMessage struct { + // Types that are valid to be assigned to Msg: + // *FileSourceMessage_FileSourceInfoUpdate + // *FileSourceMessage_RemoveFileSourceRequest + // *FileSourceMessage_RegisterFileSourceRequest + Msg isFileSourceMessage_Msg `protobuf_oneof:"msg"` +} + +func (m *FileSourceMessage) Reset() { *m = FileSourceMessage{} } +func (*FileSourceMessage) ProtoMessage() {} +func (*FileSourceMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_0046fd1b9991f89c, []int{2} +} +func (m *FileSourceMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileSourceMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FileSourceMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FileSourceMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileSourceMessage.Merge(m, src) +} +func (m *FileSourceMessage) XXX_Size() int { + return m.Size() +} +func (m *FileSourceMessage) XXX_DiscardUnknown() { + xxx_messageInfo_FileSourceMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_FileSourceMessage proto.InternalMessageInfo + +type isFileSourceMessage_Msg interface { + isFileSourceMessage_Msg() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type FileSourceMessage_FileSourceInfoUpdate struct { + FileSourceInfoUpdate *FileSourceInfoUpdate `protobuf:"bytes,1,opt,name=file_source_info_update,json=fileSourceInfoUpdate,proto3,oneof" json:"file_source_info_update,omitempty"` +} +type FileSourceMessage_RemoveFileSourceRequest struct { + RemoveFileSourceRequest *RemoveFileSourceRequest `protobuf:"bytes,2,opt,name=remove_file_source_request,json=removeFileSourceRequest,proto3,oneof" json:"remove_file_source_request,omitempty"` +} +type FileSourceMessage_RegisterFileSourceRequest struct { + RegisterFileSourceRequest *RegisterFileSourceRequest `protobuf:"bytes,3,opt,name=register_file_source_request,json=registerFileSourceRequest,proto3,oneof" json:"register_file_source_request,omitempty"` +} + +func (*FileSourceMessage_FileSourceInfoUpdate) isFileSourceMessage_Msg() {} +func (*FileSourceMessage_RemoveFileSourceRequest) isFileSourceMessage_Msg() {} +func (*FileSourceMessage_RegisterFileSourceRequest) isFileSourceMessage_Msg() {} + +func (m *FileSourceMessage) GetMsg() isFileSourceMessage_Msg { + if m != nil { + return m.Msg + } + return nil +} + +func (m *FileSourceMessage) GetFileSourceInfoUpdate() *FileSourceInfoUpdate { + if x, ok := m.GetMsg().(*FileSourceMessage_FileSourceInfoUpdate); ok { + return x.FileSourceInfoUpdate + } + return nil +} + +func (m *FileSourceMessage) GetRemoveFileSourceRequest() *RemoveFileSourceRequest { + if x, ok := m.GetMsg().(*FileSourceMessage_RemoveFileSourceRequest); ok { + return x.RemoveFileSourceRequest + } + return nil +} + +func (m *FileSourceMessage) GetRegisterFileSourceRequest() *RegisterFileSourceRequest { + if x, ok := m.GetMsg().(*FileSourceMessage_RegisterFileSourceRequest); ok { + return x.RegisterFileSourceRequest + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*FileSourceMessage) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*FileSourceMessage_FileSourceInfoUpdate)(nil), + (*FileSourceMessage_RemoveFileSourceRequest)(nil), + (*FileSourceMessage_RegisterFileSourceRequest)(nil), + } +} + type ConfigUpdateMessage struct { // Types that are valid to be assigned to Msg: // *ConfigUpdateMessage_ConfigUpdateRequest @@ -316,7 +428,7 @@ type ConfigUpdateMessage struct { func (m *ConfigUpdateMessage) Reset() { *m = ConfigUpdateMessage{} } func (*ConfigUpdateMessage) ProtoMessage() {} func (*ConfigUpdateMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{2} + return fileDescriptor_0046fd1b9991f89c, []int{3} } func (m *ConfigUpdateMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -390,7 +502,7 @@ type K8SMetadataMessage struct { func (m *K8SMetadataMessage) Reset() { *m = K8SMetadataMessage{} } func (*K8SMetadataMessage) ProtoMessage() {} func (*K8SMetadataMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{3} + return fileDescriptor_0046fd1b9991f89c, []int{4} } func (m *K8SMetadataMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -485,7 +597,7 @@ type RegisterAgentRequest struct { func (m *RegisterAgentRequest) Reset() { *m = RegisterAgentRequest{} } func (*RegisterAgentRequest) ProtoMessage() {} func (*RegisterAgentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{4} + return fileDescriptor_0046fd1b9991f89c, []int{5} } func (m *RegisterAgentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -535,7 +647,7 @@ type RegisterAgentResponse struct { func (m *RegisterAgentResponse) Reset() { *m = RegisterAgentResponse{} } func (*RegisterAgentResponse) ProtoMessage() {} func (*RegisterAgentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{5} + return fileDescriptor_0046fd1b9991f89c, []int{6} } func (m *RegisterAgentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +690,7 @@ type AgentDataInfo struct { func (m *AgentDataInfo) Reset() { *m = AgentDataInfo{} } func (*AgentDataInfo) ProtoMessage() {} func (*AgentDataInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{6} + return fileDescriptor_0046fd1b9991f89c, []int{7} } func (m *AgentDataInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +737,7 @@ type AgentUpdateInfo struct { func (m *AgentUpdateInfo) Reset() { *m = AgentUpdateInfo{} } func (*AgentUpdateInfo) ProtoMessage() {} func (*AgentUpdateInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{7} + return fileDescriptor_0046fd1b9991f89c, []int{8} } func (m *AgentUpdateInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -699,7 +811,7 @@ type Heartbeat struct { func (m *Heartbeat) Reset() { *m = Heartbeat{} } func (*Heartbeat) ProtoMessage() {} func (*Heartbeat) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{8} + return fileDescriptor_0046fd1b9991f89c, []int{9} } func (m *Heartbeat) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -764,7 +876,7 @@ type MetadataUpdateInfo struct { func (m *MetadataUpdateInfo) Reset() { *m = MetadataUpdateInfo{} } func (*MetadataUpdateInfo) ProtoMessage() {} func (*MetadataUpdateInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{9} + return fileDescriptor_0046fd1b9991f89c, []int{10} } func (m *MetadataUpdateInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -816,7 +928,7 @@ type HeartbeatAck struct { func (m *HeartbeatAck) Reset() { *m = HeartbeatAck{} } func (*HeartbeatAck) ProtoMessage() {} func (*HeartbeatAck) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{10} + return fileDescriptor_0046fd1b9991f89c, []int{11} } func (m *HeartbeatAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -873,7 +985,7 @@ type HeartbeatNack struct { func (m *HeartbeatNack) Reset() { *m = HeartbeatNack{} } func (*HeartbeatNack) ProtoMessage() {} func (*HeartbeatNack) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{11} + return fileDescriptor_0046fd1b9991f89c, []int{12} } func (m *HeartbeatNack) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -918,7 +1030,7 @@ type ExecuteQueryRequest struct { func (m *ExecuteQueryRequest) Reset() { *m = ExecuteQueryRequest{} } func (*ExecuteQueryRequest) ProtoMessage() {} func (*ExecuteQueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{12} + return fileDescriptor_0046fd1b9991f89c, []int{13} } func (m *ExecuteQueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -976,7 +1088,7 @@ type RegisterTracepointRequest struct { func (m *RegisterTracepointRequest) Reset() { *m = RegisterTracepointRequest{} } func (*RegisterTracepointRequest) ProtoMessage() {} func (*RegisterTracepointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{13} + return fileDescriptor_0046fd1b9991f89c, []int{14} } func (m *RegisterTracepointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1029,7 +1141,7 @@ type TracepointInfoUpdate struct { func (m *TracepointInfoUpdate) Reset() { *m = TracepointInfoUpdate{} } func (*TracepointInfoUpdate) ProtoMessage() {} func (*TracepointInfoUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{14} + return fileDescriptor_0046fd1b9991f89c, []int{15} } func (m *TracepointInfoUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1093,7 +1205,7 @@ type RemoveTracepointRequest struct { func (m *RemoveTracepointRequest) Reset() { *m = RemoveTracepointRequest{} } func (*RemoveTracepointRequest) ProtoMessage() {} func (*RemoveTracepointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{15} + return fileDescriptor_0046fd1b9991f89c, []int{16} } func (m *RemoveTracepointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1129,6 +1241,167 @@ func (m *RemoveTracepointRequest) GetID() *uuidpb.UUID { return nil } +type RegisterFileSourceRequest struct { + FileSourceDeployment *ir.FileSourceDeployment `protobuf:"bytes,1,opt,name=file_source_deployment,json=fileSourceDeployment,proto3" json:"file_source_deployment,omitempty"` + ID *uuidpb.UUID `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *RegisterFileSourceRequest) Reset() { *m = RegisterFileSourceRequest{} } +func (*RegisterFileSourceRequest) ProtoMessage() {} +func (*RegisterFileSourceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0046fd1b9991f89c, []int{17} +} +func (m *RegisterFileSourceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RegisterFileSourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RegisterFileSourceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RegisterFileSourceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterFileSourceRequest.Merge(m, src) +} +func (m *RegisterFileSourceRequest) XXX_Size() int { + return m.Size() +} +func (m *RegisterFileSourceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterFileSourceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterFileSourceRequest proto.InternalMessageInfo + +func (m *RegisterFileSourceRequest) GetFileSourceDeployment() *ir.FileSourceDeployment { + if m != nil { + return m.FileSourceDeployment + } + return nil +} + +func (m *RegisterFileSourceRequest) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} + +type FileSourceInfoUpdate struct { + ID *uuidpb.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State statuspb.LifeCycleState `protobuf:"varint,2,opt,name=state,proto3,enum=px.statuspb.LifeCycleState" json:"state,omitempty"` + Status *statuspb.Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + AgentID *uuidpb.UUID `protobuf:"bytes,4,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` +} + +func (m *FileSourceInfoUpdate) Reset() { *m = FileSourceInfoUpdate{} } +func (*FileSourceInfoUpdate) ProtoMessage() {} +func (*FileSourceInfoUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_0046fd1b9991f89c, []int{18} +} +func (m *FileSourceInfoUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileSourceInfoUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FileSourceInfoUpdate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FileSourceInfoUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileSourceInfoUpdate.Merge(m, src) +} +func (m *FileSourceInfoUpdate) XXX_Size() int { + return m.Size() +} +func (m *FileSourceInfoUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_FileSourceInfoUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_FileSourceInfoUpdate proto.InternalMessageInfo + +func (m *FileSourceInfoUpdate) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} + +func (m *FileSourceInfoUpdate) GetState() statuspb.LifeCycleState { + if m != nil { + return m.State + } + return statuspb.UNKNOWN_STATE +} + +func (m *FileSourceInfoUpdate) GetStatus() *statuspb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *FileSourceInfoUpdate) GetAgentID() *uuidpb.UUID { + if m != nil { + return m.AgentID + } + return nil +} + +type RemoveFileSourceRequest struct { + ID *uuidpb.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *RemoveFileSourceRequest) Reset() { *m = RemoveFileSourceRequest{} } +func (*RemoveFileSourceRequest) ProtoMessage() {} +func (*RemoveFileSourceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0046fd1b9991f89c, []int{19} +} +func (m *RemoveFileSourceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveFileSourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveFileSourceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveFileSourceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveFileSourceRequest.Merge(m, src) +} +func (m *RemoveFileSourceRequest) XXX_Size() int { + return m.Size() +} +func (m *RemoveFileSourceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveFileSourceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveFileSourceRequest proto.InternalMessageInfo + +func (m *RemoveFileSourceRequest) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} + type ConfigUpdateRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -1137,7 +1410,7 @@ type ConfigUpdateRequest struct { func (m *ConfigUpdateRequest) Reset() { *m = ConfigUpdateRequest{} } func (*ConfigUpdateRequest) ProtoMessage() {} func (*ConfigUpdateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{16} + return fileDescriptor_0046fd1b9991f89c, []int{20} } func (m *ConfigUpdateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1188,7 +1461,7 @@ type MetricsMessage struct { func (m *MetricsMessage) Reset() { *m = MetricsMessage{} } func (*MetricsMessage) ProtoMessage() {} func (*MetricsMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_0046fd1b9991f89c, []int{17} + return fileDescriptor_0046fd1b9991f89c, []int{21} } func (m *MetricsMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1234,6 +1507,7 @@ func (m *MetricsMessage) GetPodName() string { func init() { proto.RegisterType((*VizierMessage)(nil), "px.vizier.messages.VizierMessage") proto.RegisterType((*TracepointMessage)(nil), "px.vizier.messages.TracepointMessage") + proto.RegisterType((*FileSourceMessage)(nil), "px.vizier.messages.FileSourceMessage") proto.RegisterType((*ConfigUpdateMessage)(nil), "px.vizier.messages.ConfigUpdateMessage") proto.RegisterType((*K8SMetadataMessage)(nil), "px.vizier.messages.K8sMetadataMessage") proto.RegisterType((*RegisterAgentRequest)(nil), "px.vizier.messages.RegisterAgentRequest") @@ -1248,6 +1522,9 @@ func init() { proto.RegisterType((*RegisterTracepointRequest)(nil), "px.vizier.messages.RegisterTracepointRequest") proto.RegisterType((*TracepointInfoUpdate)(nil), "px.vizier.messages.TracepointInfoUpdate") proto.RegisterType((*RemoveTracepointRequest)(nil), "px.vizier.messages.RemoveTracepointRequest") + proto.RegisterType((*RegisterFileSourceRequest)(nil), "px.vizier.messages.RegisterFileSourceRequest") + proto.RegisterType((*FileSourceInfoUpdate)(nil), "px.vizier.messages.FileSourceInfoUpdate") + proto.RegisterType((*RemoveFileSourceRequest)(nil), "px.vizier.messages.RemoveFileSourceRequest") proto.RegisterType((*ConfigUpdateRequest)(nil), "px.vizier.messages.ConfigUpdateRequest") proto.RegisterType((*MetricsMessage)(nil), "px.vizier.messages.MetricsMessage") } @@ -1257,104 +1534,112 @@ func init() { } var fileDescriptor_0046fd1b9991f89c = []byte{ - // 1544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x4b, 0x6f, 0x1b, 0x47, - 0x12, 0xe6, 0x90, 0x94, 0x44, 0x95, 0xde, 0x2d, 0xc9, 0xa6, 0xfc, 0xa0, 0xb4, 0x5c, 0x78, 0x2d, - 0xdb, 0xeb, 0xe1, 0xae, 0xbc, 0x0b, 0x0b, 0x58, 0xd8, 0x58, 0x53, 0x5c, 0x58, 0xd2, 0x46, 0x86, - 0x3d, 0x92, 0x1d,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0xde, 0x4d, 0x45, 0x36, 0x6a, - 0x66, 0xd1, 0x81, 0x64, 0x13, 0x13, 0xca, 0xbc, 0x48, 0x0c, 0xa1, 0x87, 0x6e, 0x40, 0x11, 0x33, - 0xc7, 0x16, 0x17, 0x98, 0xaa, 0x97, 0x7a, 0x67, 0xcb, 0xc5, 0x27, 0xbb, 0x5b, 0x0d, 0x43, 0x48, - 0xb7, 0x8b, 0xa5, 0xfc, 0x6c, 0xa1, 0xfa, 0x1f, 0x58, 0xcc, 0xec, 0x25, 0xb1, 0xb2, 0x76, 0x81, - 0xb2, 0x05, 0x53, 0x42, 0xa9, 0x81, 0x43, 0xcc, 0xed, 0x22, 0x03, 0xa6, 0x62, 0xff, 0xa5, 0x8e, - 0x2e, 0xaa, 0x43, 0x0e, 0x0a, 0xba, 0x9a, 0x33, 0xf4, 0xbe, 0x01, 0x45, 0x8f, 0x5c, 0x23, 0x4e, - 0x3f, 0xe9, 0xa6, 0xbe, 0xaa, 0x7f, 0xe4, 0x61, 0x46, 0x58, 0x91, 0x79, 0x22, 0xec, 0x3c, 0x86, - 0x51, 0x66, 0x1d, 0x12, 0x17, 0x97, 0xf3, 0x2b, 0x85, 0x73, 0xef, 0x5a, 0xec, 0x9b, 0x78, 0x7c, - 0xd8, 0xc3, 0xcd, 0xb6, 0xd0, 0x33, 0x94, 0x16, 0x7a, 0x01, 0x33, 0x01, 0xf5, 0x2d, 0xc2, 0x98, - 0x69, 0x51, 0x82, 0x43, 0x62, 0x97, 0x8b, 0x82, 0xe8, 0x82, 0x1c, 0x7e, 0x2e, 0x15, 0x36, 0x24, - 0xde, 0x98, 0x0e, 0xfa, 0xbe, 0xd1, 0x3e, 0xa0, 0x88, 0x32, 0x24, 0xd4, 0x75, 0x3c, 0xc1, 0x3a, - 0x22, 0x58, 0xef, 0x5d, 0xca, 0xba, 0x17, 0xab, 0x18, 0x73, 0xc1, 0x79, 0x11, 0xfa, 0x3b, 0x20, - 0xdb, 0x27, 0x2c, 0xaa, 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b, 0xfb, 0xbe, 0x92, 0x3b, 0x7d, 0x5f, 0xc9, 0xed, - 0x43, 0xf2, 0x8f, 0x80, 0xe6, 0xa8, 0xf8, 0xb1, 0xf9, 0xe0, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x5c, 0x2e, 0x01, 0x20, 0x31, 0x10, 0x00, 0x00, + // 1680 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4d, 0x53, 0x1b, 0xcd, + 0x11, 0xd6, 0x4a, 0x02, 0x44, 0xf3, 0x3d, 0x80, 0x11, 0x18, 0x0b, 0xa2, 0x94, 0x63, 0x6c, 0xc7, + 0xab, 0x04, 0x27, 0x31, 0x55, 0x29, 0xbb, 0x62, 0xa1, 0xc4, 0x40, 0x82, 0xcb, 0x5e, 0xb0, 0x5d, + 0x45, 0x55, 0x6a, 0x33, 0xda, 0x1d, 0x89, 0x0d, 0xda, 0x0f, 0xcf, 0xae, 0x08, 0x72, 0x2e, 0x39, + 0xe6, 0x98, 0x43, 0x4e, 0xf9, 0x05, 0x39, 0xe7, 0x9e, 0x73, 0x72, 0xf4, 0x91, 0xaa, 0x54, 0x51, + 0xb1, 0x7c, 0x49, 0xe5, 0xbd, 0xf8, 0x27, 0xbc, 0x35, 0x1f, 0xfb, 0x21, 0x76, 0x05, 0xf8, 0xfa, + 0x9e, 0x98, 0xed, 0x79, 0xfa, 0xe9, 0x99, 0xa7, 0xa7, 0x67, 0x5a, 0xc0, 0x23, 0x9f, 0x1a, 0xb5, + 0x53, 0xeb, 0x83, 0x45, 0x68, 0xcd, 0x26, 0xbe, 0x8f, 0xdb, 0xc4, 0x8f, 0x06, 0x5e, 0x33, 0x1a, + 0xaa, 0x1e, 0x75, 0x03, 0x17, 0x21, 0xef, 0x4c, 0x15, 0x68, 0x35, 0x9c, 0x59, 0x59, 0x68, 0xbb, + 0x6d, 0x97, 0x4f, 0xd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, 0xa4, 0xfe, 0x8b, 0x8f, 0x9f, 0x2a, 0xb9, 0xf3, 0x4f, 0x95, 0xdc, 0x97, 0x4f, 0x15, + 0xe5, 0x4f, 0xfd, 0x8a, 0xf2, 0xf7, 0x7e, 0x45, 0xf9, 0x77, 0xbf, 0xa2, 0x7c, 0xec, 0x57, 0x94, + 0xff, 0xf6, 0x2b, 0xca, 0xff, 0xfa, 0x95, 0xdc, 0x97, 0x7e, 0x45, 0xf9, 0xcb, 0xe7, 0x4a, 0xee, + 0xe3, 0xe7, 0x4a, 0xee, 0xfc, 0x73, 0x25, 0x77, 0x04, 0xf1, 0x3f, 0xf1, 0x9a, 0xa3, 0xfc, 0xff, + 0x3e, 0x8f, 0xbf, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xb3, 0xac, 0xf1, 0xdd, 0xed, 0x13, 0x00, 0x00, } func (this *VizierMessage) Equal(that interface{}) bool { @@ -1603,6 +1888,30 @@ func (this *VizierMessage_K8SMetadataMessage) Equal(that interface{}) bool { } return true } +func (this *VizierMessage_FileSourceMessage) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*VizierMessage_FileSourceMessage) + if !ok { + that2, ok := that.(VizierMessage_FileSourceMessage) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.FileSourceMessage.Equal(that1.FileSourceMessage) { + return false + } + return true +} func (this *TracepointMessage) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1705,14 +2014,14 @@ func (this *TracepointMessage_RegisterTracepointRequest) Equal(that interface{}) } return true } -func (this *ConfigUpdateMessage) Equal(that interface{}) bool { +func (this *FileSourceMessage) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ConfigUpdateMessage) + that1, ok := that.(*FileSourceMessage) if !ok { - that2, ok := that.(ConfigUpdateMessage) + that2, ok := that.(FileSourceMessage) if ok { that1 = &that2 } else { @@ -1735,14 +2044,14 @@ func (this *ConfigUpdateMessage) Equal(that interface{}) bool { } return true } -func (this *ConfigUpdateMessage_ConfigUpdateRequest) Equal(that interface{}) bool { +func (this *FileSourceMessage_FileSourceInfoUpdate) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ConfigUpdateMessage_ConfigUpdateRequest) + that1, ok := that.(*FileSourceMessage_FileSourceInfoUpdate) if !ok { - that2, ok := that.(ConfigUpdateMessage_ConfigUpdateRequest) + that2, ok := that.(FileSourceMessage_FileSourceInfoUpdate) if ok { that1 = &that2 } else { @@ -1754,19 +2063,19 @@ func (this *ConfigUpdateMessage_ConfigUpdateRequest) Equal(that interface{}) boo } else if this == nil { return false } - if !this.ConfigUpdateRequest.Equal(that1.ConfigUpdateRequest) { + if !this.FileSourceInfoUpdate.Equal(that1.FileSourceInfoUpdate) { return false } return true } -func (this *K8SMetadataMessage) Equal(that interface{}) bool { +func (this *FileSourceMessage_RemoveFileSourceRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*K8SMetadataMessage) + that1, ok := that.(*FileSourceMessage_RemoveFileSourceRequest) if !ok { - that2, ok := that.(K8SMetadataMessage) + that2, ok := that.(FileSourceMessage_RemoveFileSourceRequest) if ok { that1 = &that2 } else { @@ -1778,25 +2087,19 @@ func (this *K8SMetadataMessage) Equal(that interface{}) bool { } else if this == nil { return false } - if that1.Msg == nil { - if this.Msg != nil { - return false - } - } else if this.Msg == nil { - return false - } else if !this.Msg.Equal(that1.Msg) { + if !this.RemoveFileSourceRequest.Equal(that1.RemoveFileSourceRequest) { return false } return true } -func (this *K8SMetadataMessage_K8SMetadataUpdate) Equal(that interface{}) bool { +func (this *FileSourceMessage_RegisterFileSourceRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*K8SMetadataMessage_K8SMetadataUpdate) + that1, ok := that.(*FileSourceMessage_RegisterFileSourceRequest) if !ok { - that2, ok := that.(K8SMetadataMessage_K8SMetadataUpdate) + that2, ok := that.(FileSourceMessage_RegisterFileSourceRequest) if ok { that1 = &that2 } else { @@ -1808,19 +2111,19 @@ func (this *K8SMetadataMessage_K8SMetadataUpdate) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.K8SMetadataUpdate.Equal(that1.K8SMetadataUpdate) { + if !this.RegisterFileSourceRequest.Equal(that1.RegisterFileSourceRequest) { return false } return true } -func (this *K8SMetadataMessage_MissingK8SMetadataRequest) Equal(that interface{}) bool { +func (this *ConfigUpdateMessage) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*K8SMetadataMessage_MissingK8SMetadataRequest) + that1, ok := that.(*ConfigUpdateMessage) if !ok { - that2, ok := that.(K8SMetadataMessage_MissingK8SMetadataRequest) + that2, ok := that.(ConfigUpdateMessage) if ok { that1 = &that2 } else { @@ -1832,7 +2135,115 @@ func (this *K8SMetadataMessage_MissingK8SMetadataRequest) Equal(that interface{} } else if this == nil { return false } - if !this.MissingK8SMetadataRequest.Equal(that1.MissingK8SMetadataRequest) { + if that1.Msg == nil { + if this.Msg != nil { + return false + } + } else if this.Msg == nil { + return false + } else if !this.Msg.Equal(that1.Msg) { + return false + } + return true +} +func (this *ConfigUpdateMessage_ConfigUpdateRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ConfigUpdateMessage_ConfigUpdateRequest) + if !ok { + that2, ok := that.(ConfigUpdateMessage_ConfigUpdateRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ConfigUpdateRequest.Equal(that1.ConfigUpdateRequest) { + return false + } + return true +} +func (this *K8SMetadataMessage) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*K8SMetadataMessage) + if !ok { + that2, ok := that.(K8SMetadataMessage) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Msg == nil { + if this.Msg != nil { + return false + } + } else if this.Msg == nil { + return false + } else if !this.Msg.Equal(that1.Msg) { + return false + } + return true +} +func (this *K8SMetadataMessage_K8SMetadataUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*K8SMetadataMessage_K8SMetadataUpdate) + if !ok { + that2, ok := that.(K8SMetadataMessage_K8SMetadataUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.K8SMetadataUpdate.Equal(that1.K8SMetadataUpdate) { + return false + } + return true +} +func (this *K8SMetadataMessage_MissingK8SMetadataRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*K8SMetadataMessage_MissingK8SMetadataRequest) + if !ok { + that2, ok := that.(K8SMetadataMessage_MissingK8SMetadataRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.MissingK8SMetadataRequest.Equal(that1.MissingK8SMetadataRequest) { return false } return true @@ -2220,6 +2631,90 @@ func (this *RemoveTracepointRequest) Equal(that interface{}) bool { } return true } +func (this *RegisterFileSourceRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RegisterFileSourceRequest) + if !ok { + that2, ok := that.(RegisterFileSourceRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.FileSourceDeployment.Equal(that1.FileSourceDeployment) { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + return true +} +func (this *FileSourceInfoUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FileSourceInfoUpdate) + if !ok { + that2, ok := that.(FileSourceInfoUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + if this.State != that1.State { + return false + } + if !this.Status.Equal(that1.Status) { + return false + } + if !this.AgentID.Equal(that1.AgentID) { + return false + } + return true +} +func (this *RemoveFileSourceRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RemoveFileSourceRequest) + if !ok { + that2, ok := that.(RemoveFileSourceRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + return true +} func (this *ConfigUpdateRequest) Equal(that interface{}) bool { if that == nil { return this == nil @@ -2278,7 +2773,7 @@ func (this *VizierMessage) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 13) + s := make([]string, 0, 14) s = append(s, "&messagespb.VizierMessage{") if this.Msg != nil { s = append(s, "Msg: "+fmt.Sprintf("%#v", this.Msg)+",\n") @@ -2358,6 +2853,14 @@ func (this *VizierMessage_K8SMetadataMessage) GoString() string { `K8SMetadataMessage:` + fmt.Sprintf("%#v", this.K8SMetadataMessage) + `}`}, ", ") return s } +func (this *VizierMessage_FileSourceMessage) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&messagespb.VizierMessage_FileSourceMessage{` + + `FileSourceMessage:` + fmt.Sprintf("%#v", this.FileSourceMessage) + `}`}, ", ") + return s +} func (this *TracepointMessage) GoString() string { if this == nil { return "nil" @@ -2394,6 +2897,42 @@ func (this *TracepointMessage_RegisterTracepointRequest) GoString() string { `RegisterTracepointRequest:` + fmt.Sprintf("%#v", this.RegisterTracepointRequest) + `}`}, ", ") return s } +func (this *FileSourceMessage) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&messagespb.FileSourceMessage{") + if this.Msg != nil { + s = append(s, "Msg: "+fmt.Sprintf("%#v", this.Msg)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *FileSourceMessage_FileSourceInfoUpdate) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&messagespb.FileSourceMessage_FileSourceInfoUpdate{` + + `FileSourceInfoUpdate:` + fmt.Sprintf("%#v", this.FileSourceInfoUpdate) + `}`}, ", ") + return s +} +func (this *FileSourceMessage_RemoveFileSourceRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&messagespb.FileSourceMessage_RemoveFileSourceRequest{` + + `RemoveFileSourceRequest:` + fmt.Sprintf("%#v", this.RemoveFileSourceRequest) + `}`}, ", ") + return s +} +func (this *FileSourceMessage_RegisterFileSourceRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&messagespb.FileSourceMessage_RegisterFileSourceRequest{` + + `RegisterFileSourceRequest:` + fmt.Sprintf("%#v", this.RegisterFileSourceRequest) + `}`}, ", ") + return s +} func (this *ConfigUpdateMessage) GoString() string { if this == nil { return "nil" @@ -2621,6 +3160,52 @@ func (this *RemoveTracepointRequest) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *RegisterFileSourceRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&messagespb.RegisterFileSourceRequest{") + if this.FileSourceDeployment != nil { + s = append(s, "FileSourceDeployment: "+fmt.Sprintf("%#v", this.FileSourceDeployment)+",\n") + } + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *FileSourceInfoUpdate) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&messagespb.FileSourceInfoUpdate{") + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + if this.AgentID != nil { + s = append(s, "AgentID: "+fmt.Sprintf("%#v", this.AgentID)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RemoveFileSourceRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&messagespb.RemoveFileSourceRequest{") + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} func (this *ConfigUpdateRequest) GoString() string { if this == nil { return "nil" @@ -2872,22 +3457,43 @@ func (m *VizierMessage_K8SMetadataMessage) MarshalToSizedBuffer(dAtA []byte) (in } return len(dAtA) - i, nil } -func (m *TracepointMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TracepointMessage) MarshalTo(dAtA []byte) (int, error) { +func (m *VizierMessage_FileSourceMessage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TracepointMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VizierMessage_FileSourceMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FileSourceMessage != nil { + { + size, err := m.FileSourceMessage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + return len(dAtA) - i, nil +} +func (m *TracepointMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TracepointMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TracepointMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2967,6 +3573,101 @@ func (m *TracepointMessage_RegisterTracepointRequest) MarshalToSizedBuffer(dAtA } return len(dAtA) - i, nil } +func (m *FileSourceMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileSourceMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Msg != nil { + { + size := m.Msg.Size() + i -= size + if _, err := m.Msg.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *FileSourceMessage_FileSourceInfoUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceMessage_FileSourceInfoUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FileSourceInfoUpdate != nil { + { + size, err := m.FileSourceInfoUpdate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *FileSourceMessage_RemoveFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceMessage_RemoveFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RemoveFileSourceRequest != nil { + { + size, err := m.RemoveFileSourceRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *FileSourceMessage_RegisterFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceMessage_RegisterFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RegisterFileSourceRequest != nil { + { + size, err := m.RegisterFileSourceRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} func (m *ConfigUpdateMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3682,6 +4383,152 @@ func (m *RemoveTracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *RegisterFileSourceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.FileSourceDeployment != nil { + { + size, err := m.FileSourceDeployment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FileSourceInfoUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileSourceInfoUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileSourceInfoUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AgentID != nil { + { + size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.State != 0 { + i = encodeVarintMessages(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x10 + } + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveFileSourceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMessages(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ConfigUpdateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3887,6 +4734,18 @@ func (m *VizierMessage_K8SMetadataMessage) Size() (n int) { } return n } +func (m *VizierMessage_FileSourceMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FileSourceMessage != nil { + l = m.FileSourceMessage.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} func (m *TracepointMessage) Size() (n int) { if m == nil { return 0 @@ -3935,7 +4794,7 @@ func (m *TracepointMessage_RegisterTracepointRequest) Size() (n int) { } return n } -func (m *ConfigUpdateMessage) Size() (n int) { +func (m *FileSourceMessage) Size() (n int) { if m == nil { return 0 } @@ -3947,14 +4806,62 @@ func (m *ConfigUpdateMessage) Size() (n int) { return n } -func (m *ConfigUpdateMessage_ConfigUpdateRequest) Size() (n int) { +func (m *FileSourceMessage_FileSourceInfoUpdate) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ConfigUpdateRequest != nil { - l = m.ConfigUpdateRequest.Size() + if m.FileSourceInfoUpdate != nil { + l = m.FileSourceInfoUpdate.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} +func (m *FileSourceMessage_RemoveFileSourceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RemoveFileSourceRequest != nil { + l = m.RemoveFileSourceRequest.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} +func (m *FileSourceMessage_RegisterFileSourceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RegisterFileSourceRequest != nil { + l = m.RegisterFileSourceRequest.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} +func (m *ConfigUpdateMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Msg != nil { + n += m.Msg.Size() + } + return n +} + +func (m *ConfigUpdateMessage_ConfigUpdateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConfigUpdateRequest != nil { + l = m.ConfigUpdateRequest.Size() n += 1 + l + sovMessages(uint64(l)) } return n @@ -4229,6 +5136,60 @@ func (m *RemoveTracepointRequest) Size() (n int) { return n } +func (m *RegisterFileSourceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FileSourceDeployment != nil { + l = m.FileSourceDeployment.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + +func (m *FileSourceInfoUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if m.State != 0 { + n += 1 + sovMessages(uint64(m.State)) + } + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if m.AgentID != nil { + l = m.AgentID.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + +func (m *RemoveFileSourceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovMessages(uint64(l)) + } + return n +} + func (m *ConfigUpdateRequest) Size() (n int) { if m == nil { return 0 @@ -4369,6 +5330,16 @@ func (this *VizierMessage_K8SMetadataMessage) String() string { }, "") return s } +func (this *VizierMessage_FileSourceMessage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VizierMessage_FileSourceMessage{`, + `FileSourceMessage:` + strings.Replace(fmt.Sprintf("%v", this.FileSourceMessage), "FileSourceMessage", "FileSourceMessage", 1) + `,`, + `}`, + }, "") + return s +} func (this *TracepointMessage) String() string { if this == nil { return "nil" @@ -4409,6 +5380,46 @@ func (this *TracepointMessage_RegisterTracepointRequest) String() string { }, "") return s } +func (this *FileSourceMessage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceMessage{`, + `Msg:` + fmt.Sprintf("%v", this.Msg) + `,`, + `}`, + }, "") + return s +} +func (this *FileSourceMessage_FileSourceInfoUpdate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceMessage_FileSourceInfoUpdate{`, + `FileSourceInfoUpdate:` + strings.Replace(fmt.Sprintf("%v", this.FileSourceInfoUpdate), "FileSourceInfoUpdate", "FileSourceInfoUpdate", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FileSourceMessage_RemoveFileSourceRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceMessage_RemoveFileSourceRequest{`, + `RemoveFileSourceRequest:` + strings.Replace(fmt.Sprintf("%v", this.RemoveFileSourceRequest), "RemoveFileSourceRequest", "RemoveFileSourceRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FileSourceMessage_RegisterFileSourceRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceMessage_RegisterFileSourceRequest{`, + `RegisterFileSourceRequest:` + strings.Replace(fmt.Sprintf("%v", this.RegisterFileSourceRequest), "RegisterFileSourceRequest", "RegisterFileSourceRequest", 1) + `,`, + `}`, + }, "") + return s +} func (this *ConfigUpdateMessage) String() string { if this == nil { return "nil" @@ -4621,6 +5632,40 @@ func (this *RemoveTracepointRequest) String() string { }, "") return s } +func (this *RegisterFileSourceRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RegisterFileSourceRequest{`, + `FileSourceDeployment:` + strings.Replace(fmt.Sprintf("%v", this.FileSourceDeployment), "FileSourceDeployment", "ir.FileSourceDeployment", 1) + `,`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FileSourceInfoUpdate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceInfoUpdate{`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `AgentID:` + strings.Replace(fmt.Sprintf("%v", this.AgentID), "UUID", "uuidpb.UUID", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveFileSourceRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveFileSourceRequest{`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `}`, + }, "") + return s +} func (this *ConfigUpdateRequest) String() string { if this == nil { return "nil" @@ -4995,6 +6040,41 @@ func (m *VizierMessage) Unmarshal(dAtA []byte) error { } m.Msg = &VizierMessage_K8SMetadataMessage{v} iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileSourceMessage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &FileSourceMessage{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Msg = &VizierMessage_FileSourceMessage{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -5171,7 +6251,7 @@ func (m *TracepointMessage) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConfigUpdateMessage) Unmarshal(dAtA []byte) error { +func (m *FileSourceMessage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5194,15 +6274,15 @@ func (m *ConfigUpdateMessage) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConfigUpdateMessage: wiretype end group for non-group") + return fmt.Errorf("proto: FileSourceMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigUpdateMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FileSourceMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfigUpdateRequest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileSourceInfoUpdate", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5229,65 +6309,15 @@ func (m *ConfigUpdateMessage) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ConfigUpdateRequest{} + v := &FileSourceInfoUpdate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Msg = &ConfigUpdateMessage_ConfigUpdateRequest{v} + m.Msg = &FileSourceMessage_FileSourceInfoUpdate{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *K8SMetadataMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: K8sMetadataMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: K8sMetadataMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field K8SMetadataUpdate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RemoveFileSourceRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5314,15 +6344,15 @@ func (m *K8SMetadataMessage) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &metadatapb.ResourceUpdate{} + v := &RemoveFileSourceRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Msg = &K8SMetadataMessage_K8SMetadataUpdate{v} + m.Msg = &FileSourceMessage_RemoveFileSourceRequest{v} iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MissingK8SMetadataRequest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegisterFileSourceRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5349,17 +6379,222 @@ func (m *K8SMetadataMessage) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &metadatapb.MissingK8SMetadataRequest{} + v := &RegisterFileSourceRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Msg = &K8SMetadataMessage_MissingK8SMetadataRequest{v} + m.Msg = &FileSourceMessage_RegisterFileSourceRequest{v} iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MissingK8SMetadataResponse", wireType) - } - var msglen int + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigUpdateMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigUpdateMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigUpdateMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigUpdateRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ConfigUpdateRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Msg = &ConfigUpdateMessage_ConfigUpdateRequest{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *K8SMetadataMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: K8sMetadataMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: K8sMetadataMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field K8SMetadataUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &metadatapb.ResourceUpdate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Msg = &K8SMetadataMessage_K8SMetadataUpdate{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MissingK8SMetadataRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &metadatapb.MissingK8SMetadataRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Msg = &K8SMetadataMessage_MissingK8SMetadataRequest{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MissingK8SMetadataResponse", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6874,6 +8109,391 @@ func (m *RemoveTracepointRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *RegisterFileSourceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegisterFileSourceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterFileSourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileSourceDeployment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FileSourceDeployment == nil { + m.FileSourceDeployment = &ir.FileSourceDeployment{} + } + if err := m.FileSourceDeployment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FileSourceInfoUpdate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileSourceInfoUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileSourceInfoUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= statuspb.LifeCycleState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &statuspb.Status{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentID == nil { + m.AgentID = &uuidpb.UUID{} + } + if err := m.AgentID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveFileSourceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveFileSourceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveFileSourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMessages + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ConfigUpdateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/src/vizier/messages/messagespb/messages.proto b/src/vizier/messages/messagespb/messages.proto index 92bc4785084..32e61d92dba 100644 --- a/src/vizier/messages/messagespb/messages.proto +++ b/src/vizier/messages/messagespb/messages.proto @@ -26,6 +26,7 @@ import "gogoproto/gogo.proto"; import "src/api/proto/uuidpb/uuid.proto"; import "src/carnot/planner/distributedpb/distributed_plan.proto"; import "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.proto"; +import "src/carnot/planner/file_source/ir/logical.proto"; import "src/carnot/planpb/plan.proto"; import "src/common/base/statuspb/status.proto"; import "src/shared/k8s/metadatapb/metadata.proto"; @@ -44,6 +45,7 @@ message VizierMessage { TracepointMessage tracepoint_message = 10; ConfigUpdateMessage config_update_message = 11; K8sMetadataMessage k8s_metadata_message = 12; + FileSourceMessage file_source_message = 13; } // DEPRECATED: Formerly used for UpdateAgentRequest. reserved 3; @@ -60,6 +62,15 @@ message TracepointMessage { } } +// A wrapper around all file source-related messages that can be sent over the message bus. +message FileSourceMessage { + oneof msg { + FileSourceInfoUpdate file_source_info_update = 1; + RemoveFileSourceRequest remove_file_source_request = 2; + RegisterFileSourceRequest register_file_source_request = 3; + } +} + // A wrapper around all PEM-config-related messages that can be sent over the message bus. message ConfigUpdateMessage { oneof msg { @@ -172,6 +183,27 @@ message RemoveTracepointRequest { uuidpb.UUID id = 1 [ (gogoproto.customname) = "ID" ]; } +// The request to register file sources on a PEM. +message RegisterFileSourceRequest { + px.carnot.planner.file_source.ir.FileSourceDeployment file_source_deployment = 1; + uuidpb.UUID id = 2 [ (gogoproto.customname) = "ID" ]; +} + +// An update message sent when a file source's status changes. +message FileSourceInfoUpdate { + uuidpb.UUID id = 1 [ (gogoproto.customname) = "ID" ]; + // The state of the file source. + px.statuspb.LifeCycleState state = 2; + // The status of the file source, specified if the state of the file source is not healthy. + px.statuspb.Status status = 3; + // The ID of the agent sending the update. + uuidpb.UUID agent_id = 4 [ (gogoproto.customname) = "AgentID" ]; +} + +message RemoveFileSourceRequest { + uuidpb.UUID id = 1 [ (gogoproto.customname) = "ID" ]; +} + // A request to update a config setting on a PEM. message ConfigUpdateRequest { // The key of the setting that should be updated. diff --git a/src/vizier/services/agent/kelvin/kelvin_manager.h b/src/vizier/services/agent/kelvin/kelvin_manager.h index 51b0c2fc993..2c2959736f4 100644 --- a/src/vizier/services/agent/kelvin/kelvin_manager.h +++ b/src/vizier/services/agent/kelvin/kelvin_manager.h @@ -60,6 +60,7 @@ class KelvinManager : public Manager { static services::shared::agent::AgentCapabilities Capabilities() { services::shared::agent::AgentCapabilities capabilities; capabilities.set_collects_data(false); + capabilities.set_stores_data(true); return capabilities; } diff --git a/src/vizier/services/agent/pem/file_source_manager.cc b/src/vizier/services/agent/pem/file_source_manager.cc new file mode 100644 index 00000000000..650ae2f85a6 --- /dev/null +++ b/src/vizier/services/agent/pem/file_source_manager.cc @@ -0,0 +1,234 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include "src/common/base/base.h" +#include "src/vizier/services/agent/pem/file_source_manager.h" + +constexpr auto kUpdateInterval = std::chrono::seconds(2); + +namespace px { +namespace vizier { +namespace agent { + +FileSourceManager::FileSourceManager(px::event::Dispatcher* dispatcher, Info* agent_info, + Manager::VizierNATSConnector* nats_conn, + stirling::Stirling* stirling, + table_store::TableStore* table_store, + RelationInfoManager* relation_info_manager) + : MessageHandler(dispatcher, agent_info, nats_conn), + dispatcher_(dispatcher), + nats_conn_(nats_conn), + stirling_(stirling), + table_store_(table_store), + relation_info_manager_(relation_info_manager) { + file_source_monitor_timer_ = + dispatcher_->CreateTimer(std::bind(&FileSourceManager::Monitor, this)); + // Kick off the background monitor. + file_source_monitor_timer_->EnableTimer(kUpdateInterval); +} + +Status FileSourceManager::HandleMessage(std::unique_ptr msg) { + // The main purpose of handle message is to update the local state based on updates + // from the MDS. + if (!msg->has_file_source_message()) { + return error::InvalidArgument("Can only handle file source requests"); + } + + const messages::FileSourceMessage& file_source = msg->file_source_message(); + switch (file_source.msg_case()) { + case messages::FileSourceMessage::kRegisterFileSourceRequest: { + return HandleRegisterFileSourceRequest(file_source.register_file_source_request()); + } + case messages::FileSourceMessage::kRemoveFileSourceRequest: { + return HandleRemoveFileSourceRequest(file_source.remove_file_source_request()); + } + default: + LOG(ERROR) << "Unknown message type: " << file_source.msg_case() << " skipping"; + } + return Status::OK(); +} + +std::string FileSourceManager::DebugString() const { + std::lock_guard lock(mu_); + std::stringstream ss; + auto now = std::chrono::steady_clock::now(); + ss << absl::Substitute("File Source Manager Debug State:\n"); + ss << absl::Substitute("ID\tNAME\tCURRENT_STATE\tEXPECTED_STATE\tlast_updated\n"); + for (const auto& [id, file_source] : file_sources_) { + ss << absl::Substitute( + "$0\t$1\t$2\t$3\t$4 seconds\n", id.str(), file_source.name, + statuspb::LifeCycleState_Name(file_source.current_state), + statuspb::LifeCycleState_Name(file_source.expected_state), + std::chrono::duration_cast(now - file_source.last_updated_at) + .count()); + } + return ss.str(); +} + +Status FileSourceManager::HandleRegisterFileSourceRequest( + const messages::RegisterFileSourceRequest& req) { + auto glob_pattern = req.file_source_deployment().glob_pattern(); + PX_ASSIGN_OR_RETURN(auto id, ParseUUID(req.id())); + LOG(INFO) << "Registering file source: " << glob_pattern << " uuid string=" << id.str(); + + FileSourceInfo info; + info.name = glob_pattern; + info.id = id; + info.expected_state = statuspb::RUNNING_STATE; + info.current_state = statuspb::PENDING_STATE; + info.last_updated_at = dispatcher_->GetTimeSource().MonotonicTime(); + stirling_->RegisterFileSource(id, glob_pattern); + { + std::lock_guard lock(mu_); + file_sources_[id] = std::move(info); + } + return Status::OK(); +} + +Status FileSourceManager::HandleRemoveFileSourceRequest( + const messages::RemoveFileSourceRequest& req) { + PX_ASSIGN_OR_RETURN(auto id, ParseUUID(req.id())); + std::lock_guard lock(mu_); + auto it = file_sources_.find(id); + if (it == file_sources_.end()) { + return error::NotFound("File source with ID: $0, not found", id.str()); + } + + it->second.expected_state = statuspb::TERMINATED_STATE; + return stirling_->RemoveFileSource(id); +} + +void FileSourceManager::Monitor() { + std::lock_guard lock(mu_); + + for (auto& [id, file_source] : file_sources_) { + auto s_or_publish = stirling_->GetFileSourceInfo(id); + statuspb::LifeCycleState current_state; + // Get the latest current state according to stirling. + if (s_or_publish.ok()) { + current_state = statuspb::RUNNING_STATE; + } else { + switch (s_or_publish.code()) { + case statuspb::FAILED_PRECONDITION: + // Means the binary has not been found. + current_state = statuspb::FAILED_STATE; + break; + case statuspb::RESOURCE_UNAVAILABLE: + current_state = statuspb::PENDING_STATE; + break; + case statuspb::NOT_FOUND: + // Means we didn't actually find the probe. If we requested termination, + // it's because the probe has been removed. + current_state = (file_source.expected_state == statuspb::TERMINATED_STATE) + ? statuspb::TERMINATED_STATE + : statuspb::UNKNOWN_STATE; + break; + default: + current_state = statuspb::FAILED_STATE; + break; + } + } + + if (current_state != statuspb::RUNNING_STATE && + file_source.expected_state == statuspb::TERMINATED_STATE) { + current_state = statuspb::TERMINATED_STATE; + } + + if (current_state == file_source.current_state) { + // No state transition, nothing to do. + continue; + } + + // The following transitions are legal: + // 1. Pending -> Terminated: Probe is stopped before starting. + // 2. Pending -> Running : Probe starts up. + // 3. Running -> Terminated: Probe is stopped. + // 4. Running -> Failed: Probe got dettached because binary died. + // 5. Failed -> Running: Probe started up because binary came back to life. + // + // In all cases we basically inform the MDS. + // In the cases where we transition to running, we need to update the schemas. + + Status probe_status = Status::OK(); + LOG(INFO) << absl::Substitute("File source[$0]::$1 has transitioned $2 -> $3", id.str(), + file_source.name, + statuspb::LifeCycleState_Name(file_source.current_state), + statuspb::LifeCycleState_Name(current_state)); + // Check if running now, then update the schema. + if (current_state == statuspb::RUNNING_STATE) { + // We must have just transitioned into running. We try to apply the new schema. + // If it fails we will trigger an error and report that to MDS. + auto publish_pb = s_or_publish.ConsumeValueOrDie(); + auto s = UpdateSchema(publish_pb); + if (!s.ok()) { + current_state = statuspb::FAILED_STATE; + probe_status = s; + } + } else { + probe_status = s_or_publish.status(); + } + + file_source.current_state = current_state; + + // Update MDS with the latest status. + px::vizier::messages::VizierMessage msg; + auto file_source_msg = msg.mutable_file_source_message(); + auto update_msg = file_source_msg->mutable_file_source_info_update(); + ToProto(agent_info()->agent_id, update_msg->mutable_agent_id()); + ToProto(id, update_msg->mutable_id()); + update_msg->set_state(file_source.current_state); + probe_status.ToProto(update_msg->mutable_status()); + VLOG(1) << "Sending file source info update message: " << msg.DebugString(); + auto s = nats_conn_->Publish(msg); + if (!s.ok()) { + LOG(ERROR) << "Failed to update nats"; + } + } + file_source_monitor_timer_->EnableTimer(kUpdateInterval); +} + +Status FileSourceManager::UpdateSchema(const stirling::stirlingpb::Publish& publish_pb) { + LOG(INFO) << "Updating schema for file source"; + auto relation_info_vec = ConvertPublishPBToRelationInfo(publish_pb); + // TODO(zasgar): Failure here can lead to an inconsistent schema state. We should + // figure out how to handle this as part of the data model refactor project. + for (const auto& relation_info : relation_info_vec) { + if (!relation_info_manager_->HasRelation(relation_info.name)) { + table_store_->AddTable( + table_store::HotColdTable::Create(relation_info.name, relation_info.relation), + relation_info.name, relation_info.id); + PX_RETURN_IF_ERROR(relation_info_manager_->AddRelationInfo(relation_info)); + } else { + if (relation_info.relation != table_store_->GetTable(relation_info.name)->GetRelation()) { + return error::Internal( + "File source is not compatible with the schema of the specified output table. " + "[table_name=$0]", + relation_info.name); + } + PX_RETURN_IF_ERROR(table_store_->AddTableAlias(relation_info.id, relation_info.name)); + } + } + return Status::OK(); +} + +} // namespace agent +} // namespace vizier +} // namespace px diff --git a/src/vizier/services/agent/pem/file_source_manager.h b/src/vizier/services/agent/pem/file_source_manager.h new file mode 100644 index 00000000000..f45d346f5f2 --- /dev/null +++ b/src/vizier/services/agent/pem/file_source_manager.h @@ -0,0 +1,73 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include + +#include + +#include "src/stirling/stirling.h" +#include "src/vizier/services/agent/shared/manager/manager.h" + +namespace px { +namespace vizier { +namespace agent { + +struct FileSourceInfo { + std::string name; + sole::uuid id; + statuspb::LifeCycleState expected_state; + statuspb::LifeCycleState current_state; + std::chrono::time_point last_updated_at; +}; + +class FileSourceManager : public Manager::MessageHandler { + public: + FileSourceManager() = delete; + FileSourceManager(px::event::Dispatcher* dispatcher, Info* agent_info, + Manager::VizierNATSConnector* nats_conn, stirling::Stirling* stirling, + table_store::TableStore* table_store, + RelationInfoManager* relation_info_manager); + + Status HandleMessage(std::unique_ptr msg) override; + std::string DebugString() const; + Status HandleRegisterFileSourceRequest(const messages::RegisterFileSourceRequest& req); + Status HandleRemoveFileSourceRequest(const messages::RemoveFileSourceRequest& req); + + private: + // The tracepoint Monitor that is responsible for watching and updating the state of + // active tracepoints. + void Monitor(); + Status UpdateSchema(const stirling::stirlingpb::Publish& publish_proto); + + px::event::Dispatcher* dispatcher_; + Manager::VizierNATSConnector* nats_conn_; + stirling::Stirling* stirling_; + table_store::TableStore* table_store_; + RelationInfoManager* relation_info_manager_; + + event::TimerUPtr file_source_monitor_timer_; + mutable std::mutex mu_; + absl::flat_hash_map file_sources_; +}; + +} // namespace agent +} // namespace vizier +} // namespace px diff --git a/src/vizier/services/agent/pem/pem_manager.cc b/src/vizier/services/agent/pem/pem_manager.cc index ff9f1e0ffad..c73444b9b6c 100644 --- a/src/vizier/services/agent/pem/pem_manager.cc +++ b/src/vizier/services/agent/pem/pem_manager.cc @@ -78,6 +78,11 @@ Status PEMManager::PostRegisterHookImpl() { stirling_.get(), table_store(), relation_info_manager()); PX_RETURN_IF_ERROR(RegisterMessageHandler(messages::VizierMessage::MsgCase::kTracepointMessage, tracepoint_manager_)); + file_source_manager_ = + std::make_shared(dispatcher(), info(), agent_nats_connector(), + stirling_.get(), table_store(), relation_info_manager()); + PX_RETURN_IF_ERROR(RegisterMessageHandler(messages::VizierMessage::MsgCase::kFileSourceMessage, + file_source_manager_)); return Status::OK(); } @@ -145,20 +150,20 @@ Status PEMManager::InitSchemas() { // Special case to set the max size of the http_events table differently from the other // tables. For now, the min cold batch size is set to 256kB to be consistent with previous // behaviour. - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - http_table_size, 256 * 1024); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, http_table_size, 256 * 1024); } else if (relation_info.name == "stirling_error") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - stirling_error_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, stirling_error_table_size); } else if (relation_info.name == "probe_status") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - probe_status_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, probe_status_table_size); } else if (relation_info.name == "proc_exit_events") { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - proc_exit_events_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, proc_exit_events_table_size); } else { - table_ptr = std::make_shared(relation_info.name, relation_info.relation, - other_table_size); + table_ptr = std::make_shared( + relation_info.name, relation_info.relation, other_table_size); } table_store()->AddTable(std::move(table_ptr), relation_info.name, relation_info.id); diff --git a/src/vizier/services/agent/pem/pem_manager.h b/src/vizier/services/agent/pem/pem_manager.h index 9dcbab9b4f9..d9c138355d9 100644 --- a/src/vizier/services/agent/pem/pem_manager.h +++ b/src/vizier/services/agent/pem/pem_manager.h @@ -28,6 +28,7 @@ #include "src/common/system/kernel_version.h" #include "src/stirling/stirling.h" +#include "src/vizier/services/agent/pem/file_source_manager.h" #include "src/vizier/services/agent/pem/tracepoint_manager.h" #include "src/vizier/services/agent/shared/manager/manager.h" @@ -104,6 +105,7 @@ class PEMManager : public Manager { std::unique_ptr stirling_; std::shared_ptr tracepoint_manager_; + std::shared_ptr file_source_manager_; // Timer for triggering ClockConverter polls. px::event::TimerUPtr clock_converter_timer_; diff --git a/src/vizier/services/agent/pem/tracepoint_manager.cc b/src/vizier/services/agent/pem/tracepoint_manager.cc index 3c7453c0313..65a18370bd7 100644 --- a/src/vizier/services/agent/pem/tracepoint_manager.cc +++ b/src/vizier/services/agent/pem/tracepoint_manager.cc @@ -204,6 +204,7 @@ void TracepointManager::Monitor() { ToProto(id, update_msg->mutable_id()); update_msg->set_state(tracepoint.current_state); probe_status.ToProto(update_msg->mutable_status()); + VLOG(1) << "Sending tracepoint info update message: " << msg.DebugString(); auto s = nats_conn_->Publish(msg); if (!s.ok()) { LOG(ERROR) << "Failed to update nats"; @@ -219,8 +220,9 @@ Status TracepointManager::UpdateSchema(const stirling::stirlingpb::Publish& publ // figure out how to handle this as part of the data model refactor project. for (const auto& relation_info : relation_info_vec) { if (!relation_info_manager_->HasRelation(relation_info.name)) { - table_store_->AddTable(table_store::Table::Create(relation_info.name, relation_info.relation), - relation_info.name, relation_info.id); + table_store_->AddTable( + table_store::HotColdTable::Create(relation_info.name, relation_info.relation), + relation_info.name, relation_info.id); PX_RETURN_IF_ERROR(relation_info_manager_->AddRelationInfo(relation_info)); } else { if (relation_info.relation != table_store_->GetTable(relation_info.name)->GetRelation()) { diff --git a/src/vizier/services/agent/shared/manager/BUILD.bazel b/src/vizier/services/agent/shared/manager/BUILD.bazel index 7ba7ff6b8cc..2bf527935d4 100644 --- a/src/vizier/services/agent/shared/manager/BUILD.bazel +++ b/src/vizier/services/agent/shared/manager/BUILD.bazel @@ -42,6 +42,7 @@ pl_cc_library( "//src/vizier/funcs:cc_library", "//src/vizier/messages/messagespb:messages_pl_cc_proto", "//src/vizier/services/agent/shared/base:cc_library", + "//src/stirling/source_connectors/stirling_error:cc_library", "//third_party:natsc", "@com_github_arun11299_cpp_jwt//:cpp_jwt", "@com_github_cameron314_concurrentqueue//:concurrentqueue", diff --git a/src/vizier/services/agent/shared/manager/heartbeat.cc b/src/vizier/services/agent/shared/manager/heartbeat.cc index 4b48c5c68a6..0f0e77aeef5 100644 --- a/src/vizier/services/agent/shared/manager/heartbeat.cc +++ b/src/vizier/services/agent/shared/manager/heartbeat.cc @@ -100,7 +100,8 @@ Status HeartbeatMessageHandler::SendHeartbeatInternal() { auto* update_info = hb->mutable_update_info(); ConsumeAgentPIDUpdates(update_info); - if (agent_info()->capabilities.collects_data() && + auto capabilities = agent_info()->capabilities; + if ((capabilities.collects_data() || capabilities.stores_data()) && (!sent_schema_ || relation_info_manager_->has_updates())) { sent_schema_ = true; relation_info_manager_->AddSchemaToUpdateInfo(update_info); diff --git a/src/vizier/services/agent/shared/manager/heartbeat.h b/src/vizier/services/agent/shared/manager/heartbeat.h index ea7a88dd352..50361997854 100644 --- a/src/vizier/services/agent/shared/manager/heartbeat.h +++ b/src/vizier/services/agent/shared/manager/heartbeat.h @@ -21,12 +21,19 @@ #include #include "src/vizier/services/agent/shared/manager/manager.h" +#include "src/table_store/table_store.h" +#include "src/shared/schema/utils.h" +#include "src/stirling/source_connectors/stirling_error/sink_results_table.h" +#include "src/stirling/core/pub_sub_manager.h" namespace px { namespace vizier { namespace agent { class HeartbeatMessageHandler : public Manager::MessageHandler { + + const std::string kSinkResultsTableName = "sink_results"; + public: HeartbeatMessageHandler() = delete; HeartbeatMessageHandler(px::event::Dispatcher* dispatcher, @@ -40,6 +47,20 @@ class HeartbeatMessageHandler : public Manager::MessageHandler { void DisableHeartbeats(); void EnableHeartbeats(); + Status CreateSinkResultsTable(table_store::TableStore* table_store) { + auto mgr = std::make_unique(stirling::kSinkResultsTable); + std::vector> mgrs; + mgrs.push_back(std::move(mgr)); + stirling::stirlingpb::Publish publish_pb; + PopulatePublishProto(&publish_pb, mgrs); + auto relation_info_vec = ConvertPublishPBToRelationInfo(publish_pb); + auto relation_info = relation_info_vec[0]; + auto table = table_store::HotColdTable::Create(relation_info.name, relation_info.relation); + table_store->AddTable(std::move(table), relation_info.name, relation_info.id); + PX_RETURN_IF_ERROR(relation_info_manager_->AddRelationInfo(relation_info)); + return Status::OK(); + } + private: void ConsumeAgentPIDUpdates(messages::AgentUpdateInfo* update_info); void ProcessPIDStartedEvent(const px::md::PIDStartedEvent& ev, diff --git a/src/vizier/services/agent/shared/manager/heartbeat_test.cc b/src/vizier/services/agent/shared/manager/heartbeat_test.cc index 249a34ea1fc..666c3223f15 100644 --- a/src/vizier/services/agent/shared/manager/heartbeat_test.cc +++ b/src/vizier/services/agent/shared/manager/heartbeat_test.cc @@ -114,10 +114,10 @@ class HeartbeatMessageHandlerTest : public ::testing::Test { // Relation info with no tabletization. Relation relation0({types::TIME64NS, types::INT64}, {"time_", "count"}); - RelationInfo relation_info0("relation0", /* id */ 0, "desc0", relation0); + RelationInfo relation_info0("relation0", /* id */ 0, "desc0", std::nullopt, relation0); // Relation info with no tabletization. Relation relation1({types::TIME64NS, types::FLOAT64}, {"time_", "gauge"}); - RelationInfo relation_info1("relation1", /* id */ 1, "desc1", relation1); + RelationInfo relation_info1("relation1", /* id */ 1, "desc1", std::nullopt, relation1); std::vector relation_info_vec({relation_info0, relation_info1}); // Pass relation info to the manager. relation_info_manager_ = std::make_unique(); @@ -299,7 +299,7 @@ TEST_F(HeartbeatMessageHandlerTest, HandleHeartbeatRelationUpdates) { auto s = heartbeat_handler_->HandleMessage(std::move(hb_ack)); Relation relation2({types::TIME64NS, types::FLOAT64}, {"time_", "gauge"}); - RelationInfo relation_info2("relation2", /* id */ 1, "desc2", relation2); + RelationInfo relation_info2("relation2", /* id */ 1, "desc2", std::nullopt, relation2); s = relation_info_manager_->AddRelationInfo(relation_info2); time_system_->Sleep(std::chrono::milliseconds(5 * 5000 + 1)); diff --git a/src/vizier/services/agent/shared/manager/manager.cc b/src/vizier/services/agent/shared/manager/manager.cc index 004eb5ba2ea..01efe60044b 100644 --- a/src/vizier/services/agent/shared/manager/manager.cc +++ b/src/vizier/services/agent/shared/manager/manager.cc @@ -87,6 +87,13 @@ Manager::MDTPServiceSPtr CreateMDTPStub(const std::shared_ptr& ch return std::make_shared(chan); } +Manager::MDFSServiceSPtr CreateMDFSStub(const std::shared_ptr& chan) { + if (chan == nullptr) { + return nullptr; + } + return std::make_shared(chan); +} + std::shared_ptr CreateCronScriptStub( const std::shared_ptr& chan) { if (chan == nullptr) { @@ -108,7 +115,7 @@ Manager::Manager(sole::uuid agent_id, std::string_view pod_name, std::string_vie relation_info_manager_(std::make_unique()), mds_channel_(grpc::CreateChannel(std::string(mds_url), grpc_channel_creds_)), func_context_(this, CreateMDSStub(mds_channel_), CreateMDTPStub(mds_channel_), - CreateCronScriptStub(mds_channel_), table_store_, + CreateMDFSStub(mds_channel_), CreateCronScriptStub(mds_channel_), table_store_, [](grpc::ClientContext* ctx) { AddServiceTokenToClientContext(ctx); }), memory_metrics_(&GetMetricsRegistry(), "agent_id", agent_id.str()) { // Register Vizier specific and carnot builtin functions. @@ -229,6 +236,10 @@ Status Manager::RegisterBackgroundHelpers() { heartbeat_handler_ = std::make_shared( dispatcher_.get(), mds_manager_.get(), relation_info_manager_.get(), &info_, agent_nats_connector_.get()); + if (info_.capabilities.stores_data()) { + LOG(INFO) << "Creating results table"; + PX_RETURN_IF_ERROR(heartbeat_handler_->CreateSinkResultsTable(table_store())); + } auto heartbeat_nack_handler = std::make_shared( dispatcher_.get(), &info_, agent_nats_connector_.get(), @@ -288,8 +299,11 @@ Status Manager::PostRegisterHook(uint32_t asid) { LOG_IF(FATAL, info_.asid != 0) << "Attempted to register existing agent with new ASID"; info_.asid = asid; + const std::string proc_pid_path = std::string("/proc/") + std::to_string(info_.pid); + PX_ASSIGN_OR_RETURN(auto start_time, system::GetPIDStartTimeTicks(proc_pid_path)); + mds_manager_ = std::make_unique( - info_.hostname, info_.asid, info_.pid, info_.pod_name, info_.agent_id, + info_.hostname, info_.asid, info_.pid, start_time, info_.pod_name, info_.agent_id, info_.capabilities.collects_data(), px::system::Config::GetInstance(), agent_metadata_filter_.get(), sole::rebuild(FLAGS_vizier_id), FLAGS_vizier_name, FLAGS_vizier_namespace, time_system_.get()); diff --git a/src/vizier/services/agent/shared/manager/manager.h b/src/vizier/services/agent/shared/manager/manager.h index 3d7a8a4f49e..af2cd912a5a 100644 --- a/src/vizier/services/agent/shared/manager/manager.h +++ b/src/vizier/services/agent/shared/manager/manager.h @@ -92,6 +92,8 @@ class Manager : public BaseManager { using MDSServiceSPtr = std::shared_ptr; using MDTPService = services::metadata::MetadataTracepointService; using MDTPServiceSPtr = std::shared_ptr; + using MDFSService = services::metadata::MetadataFileSourceService; + using MDFSServiceSPtr = std::shared_ptr; using ResultSinkStub = px::carnotpb::ResultSinkService::StubInterface; Manager() = delete; diff --git a/src/vizier/services/agent/shared/manager/relation_info_manager.cc b/src/vizier/services/agent/shared/manager/relation_info_manager.cc index cb3fc51ea8b..d227978224c 100644 --- a/src/vizier/services/agent/shared/manager/relation_info_manager.cc +++ b/src/vizier/services/agent/shared/manager/relation_info_manager.cc @@ -54,6 +54,9 @@ void RelationInfoManager::AddSchemaToUpdateInfo(messages::AgentUpdateInfo* updat schema->set_tabletized(relation_info.tabletized); schema->set_tabletization_key(relation.GetColumnName(relation_info.tabletization_key_idx)); } + if (relation_info.mutation_id.has_value()) { + schema->set_mutation_id(relation_info.mutation_id.value()); + } for (size_t i = 0; i < relation.NumColumns(); ++i) { auto* column = schema->add_columns(); column->set_name(relation.GetColumnName(i)); diff --git a/src/vizier/services/agent/shared/manager/relation_info_manager_test.cc b/src/vizier/services/agent/shared/manager/relation_info_manager_test.cc index 7f9a06c750c..abeb919847c 100644 --- a/src/vizier/services/agent/shared/manager/relation_info_manager_test.cc +++ b/src/vizier/services/agent/shared/manager/relation_info_manager_test.cc @@ -75,11 +75,11 @@ schema { TEST_F(RelationInfoManagerTest, test_update) { // Relation info with no tabletization. Relation relation0({types::TIME64NS, types::INT64}, {"time_", "count"}); - RelationInfo relation_info0("relation0", /* id */ 0, "desc0", relation0); + RelationInfo relation_info0("relation0", /* id */ 0, "desc0", std::nullopt, relation0); // Relation info with no tabletization. Relation relation1({types::TIME64NS, types::FLOAT64}, {"time_", "gauge"}); - RelationInfo relation_info1("relation1", /* id */ 1, "desc1", relation1); + RelationInfo relation_info1("relation1", /* id */ 1, "desc1", std::nullopt, relation1); EXPECT_OK(relation_info_manager_->AddRelationInfo(std::move(relation_info0))); EXPECT_OK(relation_info_manager_->AddRelationInfo(std::move(relation_info1))); @@ -131,12 +131,12 @@ schema { TEST_F(RelationInfoManagerTest, test_tabletization_keys) { // Relation info with no tabletization. Relation relation0({types::TIME64NS, types::INT64}, {"time_", "count"}); - RelationInfo relation_info0("relation0", /* id */ 0, "desc0", relation0); + RelationInfo relation_info0("relation0", /* id */ 0, "desc0", std::nullopt, relation0); // Relation info with a tablet key ("upid"). Relation relation1({types::TIME64NS, types::UINT128, types::INT64}, {"time_", "upid", "count"}); RelationInfo relation_info1("relation1", /* id */ 1, "desc1", /* tabletization_key_idx */ 1, - relation1); + std::nullopt, relation1); EXPECT_FALSE(relation_info_manager_->has_updates()); diff --git a/src/vizier/services/metadata/BUILD.bazel b/src/vizier/services/metadata/BUILD.bazel index 9d52501dcd2..f885bd1c777 100644 --- a/src/vizier/services/metadata/BUILD.bazel +++ b/src/vizier/services/metadata/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//src/vizier/services/metadata/controllers", "//src/vizier/services/metadata/controllers/agent", "//src/vizier/services/metadata/controllers/cronscript", + "//src/vizier/services/metadata/controllers/file_source", "//src/vizier/services/metadata/controllers/k8smeta", "//src/vizier/services/metadata/controllers/tracepoint", "//src/vizier/services/metadata/metadataenv", diff --git a/src/vizier/services/metadata/controllers/BUILD.bazel b/src/vizier/services/metadata/controllers/BUILD.bazel index 0fd8cc0fee5..ca6fe64f35a 100644 --- a/src/vizier/services/metadata/controllers/BUILD.bazel +++ b/src/vizier/services/metadata/controllers/BUILD.bazel @@ -35,6 +35,7 @@ go_library( "//src/utils", "//src/vizier/messages/messagespb:messages_pl_go_proto", "//src/vizier/services/metadata/controllers/agent", + "//src/vizier/services/metadata/controllers/file_source", "//src/vizier/services/metadata/controllers/k8smeta", "//src/vizier/services/metadata/controllers/tracepoint", "//src/vizier/services/metadata/metadataenv", @@ -78,6 +79,8 @@ pl_go_test( "//src/vizier/messages/messagespb:messages_pl_go_proto", "//src/vizier/services/metadata/controllers/agent", "//src/vizier/services/metadata/controllers/agent/mock", + "//src/vizier/services/metadata/controllers/file_source", + "//src/vizier/services/metadata/controllers/file_source/mock", "//src/vizier/services/metadata/controllers/testutils", "//src/vizier/services/metadata/controllers/tracepoint", "//src/vizier/services/metadata/controllers/tracepoint/mock", diff --git a/src/vizier/services/metadata/controllers/agent_topic_listener.go b/src/vizier/services/metadata/controllers/agent_topic_listener.go index e8b72cfa463..13743e6ba6f 100644 --- a/src/vizier/services/metadata/controllers/agent_topic_listener.go +++ b/src/vizier/services/metadata/controllers/agent_topic_listener.go @@ -32,6 +32,7 @@ import ( "px.dev/pixie/src/utils" "px.dev/pixie/src/vizier/messages/messagespb" "px.dev/pixie/src/vizier/services/metadata/controllers/agent" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" "px.dev/pixie/src/vizier/services/shared/agentpb" "px.dev/pixie/src/vizier/utils/messagebus" @@ -80,6 +81,7 @@ func (c *concurrentAgentMap) delete(agentID uuid.UUID) { type AgentTopicListener struct { agtMgr agent.Manager tpMgr *tracepoint.Manager + fsMgr *file_source.Manager sendMessage SendMessageFn // Map from agent ID -> the agentHandler that's responsible for handling that particular @@ -92,6 +94,7 @@ type AgentHandler struct { id uuid.UUID agtMgr agent.Manager tpMgr *tracepoint.Manager + fsMgr *file_source.Manager atl *AgentTopicListener MsgChannel chan *nats.Msg @@ -103,11 +106,12 @@ type AgentHandler struct { // NewAgentTopicListener creates a new agent topic listener. func NewAgentTopicListener(agtMgr agent.Manager, tpMgr *tracepoint.Manager, - sendMsgFn SendMessageFn, -) (*AgentTopicListener, error) { + fsMgr *file_source.Manager, + sendMsgFn SendMessageFn) (*AgentTopicListener, error) { atl := &AgentTopicListener{ agtMgr: agtMgr, tpMgr: tpMgr, + fsMgr: fsMgr, sendMessage: sendMsgFn, agentMap: &concurrentAgentMap{unsafeMap: make(map[uuid.UUID]*AgentHandler)}, } @@ -162,6 +166,8 @@ func (a *AgentTopicListener) HandleMessage(msg *nats.Msg) error { a.forwardAgentRegisterRequest(m.RegisterAgentRequest, msg) case *messagespb.VizierMessage_TracepointMessage: a.onAgentTracepointMessage(m.TracepointMessage) + case *messagespb.VizierMessage_FileSourceMessage: + a.onAgentFileSourceMessage(m.FileSourceMessage) default: log.WithField("message-type", reflect.TypeOf(pb.Msg).String()). Error("Unhandled message.") @@ -191,6 +197,7 @@ func (a *AgentTopicListener) createAgentHandler(agentID uuid.UUID) *AgentHandler id: agentID, agtMgr: a.agtMgr, tpMgr: a.tpMgr, + fsMgr: a.fsMgr, atl: a, MsgChannel: make(chan *nats.Msg, 10), quitCh: make(chan struct{}), @@ -292,6 +299,23 @@ func (a *AgentTopicListener) onAgentTracepointInfoUpdate(m *messagespb.Tracepoin } } +func (a *AgentTopicListener) onAgentFileSourceMessage(pbMessage *messagespb.FileSourceMessage) { + switch m := pbMessage.Msg.(type) { + case *messagespb.FileSourceMessage_FileSourceInfoUpdate: + a.onAgentFileSourceInfoUpdate(m.FileSourceInfoUpdate) + default: + log.WithField("message-type", reflect.TypeOf(pbMessage.Msg).String()). + Error("Unhandled message.") + } +} + +func (a *AgentTopicListener) onAgentFileSourceInfoUpdate(m *messagespb.FileSourceInfoUpdate) { + err := a.fsMgr.UpdateAgentFileSourceStatus(m.ID, m.AgentID, m.State, m.Status) + if err != nil { + log.WithError(err).Error("Could not update agent tracepoint status") + } +} + // Stop stops processing any agent messagespb. func (a *AgentTopicListener) Stop() { // Grab all the handlers in one go since calling stop will modify the map and need @@ -433,6 +457,22 @@ func (ah *AgentHandler) onAgentRegisterRequest(m *messagespb.RegisterAgentReques } } } + + // Register all file sources on new agent. + fileSources, err := ah.fsMgr.GetAllFileSources() + if err != nil { + log.WithError(err).Error("Could not get all file sources") + return + } + + for _, fs := range fileSources { + if fs.ExpectedState != statuspb.TERMINATED_STATE { + err = ah.fsMgr.RegisterFileSource(agent, utils.UUIDFromProtoOrNil(fs.ID), fs.FileSource) + if err != nil { + log.WithError(err).Error("Failed to send RegisterFileSource request") + } + } + } }() } diff --git a/src/vizier/services/metadata/controllers/agent_topic_listener_test.go b/src/vizier/services/metadata/controllers/agent_topic_listener_test.go index c71ac335204..ad6f8369039 100644 --- a/src/vizier/services/metadata/controllers/agent_topic_listener_test.go +++ b/src/vizier/services/metadata/controllers/agent_topic_listener_test.go @@ -38,6 +38,8 @@ import ( "px.dev/pixie/src/vizier/services/metadata/controllers" "px.dev/pixie/src/vizier/services/metadata/controllers/agent" mock_agent "px.dev/pixie/src/vizier/services/metadata/controllers/agent/mock" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" + mock_file_source "px.dev/pixie/src/vizier/services/metadata/controllers/file_source/mock" "px.dev/pixie/src/vizier/services/metadata/controllers/testutils" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" mock_tracepoint "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint/mock" @@ -64,11 +66,12 @@ func assertSendMessageCalledWith(t *testing.T, expTopic string, expMsg messagesp } } -func setup(t *testing.T, sendMsgFn controllers.SendMessageFn) (*controllers.AgentTopicListener, *mock_agent.MockManager, *mock_tracepoint.MockStore, func()) { +func setup(t *testing.T, sendMsgFn controllers.SendMessageFn) (*controllers.AgentTopicListener, *mock_agent.MockManager, *mock_tracepoint.MockStore, *mock_file_source.MockStore, func()) { ctrl := gomock.NewController(t) mockAgtMgr := mock_agent.NewMockManager(ctrl) mockTracepointStore := mock_tracepoint.NewMockStore(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) agentInfo := new(agentpb.Agent) if err := proto.UnmarshalText(testutils.UnhealthyKelvinAgentInfo, agentInfo); err != nil { @@ -82,14 +85,16 @@ func setup(t *testing.T, sendMsgFn controllers.SendMessageFn) (*controllers.Agen Return([]*agentpb.Agent{agentInfo}, nil) tracepointMgr := tracepoint.NewManager(mockTracepointStore, mockAgtMgr, 5*time.Second) - atl, _ := controllers.NewAgentTopicListener(mockAgtMgr, tracepointMgr, sendMsgFn) + fsMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + atl, _ := controllers.NewAgentTopicListener(mockAgtMgr, tracepointMgr, fsMgr, sendMsgFn) cleanup := func() { ctrl.Finish() tracepointMgr.Close() + fsMgr.Close() } - return atl, mockAgtMgr, mockTracepointStore, cleanup + return atl, mockAgtMgr, mockTracepointStore, mockFileSourceStore, cleanup } func TestAgentRegisterRequest(t *testing.T) { @@ -109,8 +114,8 @@ func TestAgentRegisterRequest(t *testing.T) { // Set up mock. var wg sync.WaitGroup - wg.Add(1) - atl, mockAgtMgr, mockTracepointStore, cleanup := setup(t, sendMsg) + wg.Add(2) + atl, mockAgtMgr, mockTracepointStore, mockFileSourceStore, cleanup := setup(t, sendMsg) defer cleanup() agentInfo := &agentpb.Agent{ @@ -139,6 +144,14 @@ func TestAgentRegisterRequest(t *testing.T) { return nil, nil }) + mockFileSourceStore. + EXPECT(). + GetFileSources(). + DoAndReturn(func() ([]*storepb.FileSourceInfo, error) { + wg.Done() + return nil, nil + }) + req := new(messagespb.VizierMessage) if err := proto.UnmarshalText(testutils.RegisterAgentRequestPB, req); err != nil { t.Fatal("Cannot Unmarshal protobuf.") @@ -187,8 +200,8 @@ func TestKelvinRegisterRequest(t *testing.T) { // Set up mock. var wg sync.WaitGroup - wg.Add(1) - atl, mockAgtMgr, mockTracepointStore, cleanup := setup(t, sendMsg) + wg.Add(2) + atl, mockAgtMgr, mockTracepointStore, mockFileSourceStore, cleanup := setup(t, sendMsg) defer cleanup() agentInfo := &agentpb.Agent{ @@ -217,6 +230,14 @@ func TestKelvinRegisterRequest(t *testing.T) { return nil, nil }) + mockFileSourceStore. + EXPECT(). + GetFileSources(). + DoAndReturn(func() ([]*storepb.FileSourceInfo, error) { + wg.Done() + return nil, nil + }) + req := new(messagespb.VizierMessage) if err := proto.UnmarshalText(testutils.RegisterKelvinRequestPB, req); err != nil { t.Fatal("Cannot Unmarshal protobuf.") @@ -262,8 +283,8 @@ func TestAgentReRegisterRequest(t *testing.T) { // Set up mock. var wg sync.WaitGroup - wg.Add(1) - atl, mockAgtMgr, mockTracepointStore, cleanup := setup(t, sendMsg) + wg.Add(2) + atl, mockAgtMgr, mockTracepointStore, mockFileSourceStore, cleanup := setup(t, sendMsg) defer cleanup() agentInfo := &agentpb.Agent{ @@ -293,6 +314,14 @@ func TestAgentReRegisterRequest(t *testing.T) { return nil, nil }) + mockFileSourceStore. + EXPECT(). + GetFileSources(). + DoAndReturn(func() ([]*storepb.FileSourceInfo, error) { + wg.Done() + return nil, nil + }) + req := new(messagespb.VizierMessage) if err := proto.UnmarshalText(testutils.ReregisterPurgedAgentRequestPB, req); err != nil { t.Fatal("Cannot Unmarshal protobuf.") @@ -326,7 +355,7 @@ func TestAgentReRegisterRequest(t *testing.T) { func TestAgentRegisterRequestInvalidUUID(t *testing.T) { // Set up mock. - atl, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) + atl, _, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) defer cleanup() req := new(messagespb.VizierMessage) @@ -344,7 +373,7 @@ func TestAgentRegisterRequestInvalidUUID(t *testing.T) { func TestAgentCreateFailed(t *testing.T) { var wg sync.WaitGroup - atl, mockAgtMgr, _, cleanup := setup(t, assertSendMessageUncalled(t)) + atl, mockAgtMgr, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) defer cleanup() req := new(messagespb.VizierMessage) @@ -398,7 +427,7 @@ func TestAgentHeartbeat(t *testing.T) { // Set up mock. var wg sync.WaitGroup - atl, mockAgtMgr, _, cleanup := setup(t, func(topic string, b []byte) error { + atl, mockAgtMgr, _, _, cleanup := setup(t, func(topic string, b []byte) error { msg := messagespb.VizierMessage{} if err := proto.Unmarshal(b, &msg); err != nil { t.Fatal("Cannot Unmarshal protobuf.") @@ -474,7 +503,7 @@ func TestAgentHeartbeat_Failed(t *testing.T) { require.NoError(t, err) // Set up mock. - atl, mockAgtMgr, _, cleanup := setup(t, sendMsg) + atl, mockAgtMgr, _, _, cleanup := setup(t, sendMsg) defer cleanup() var wg sync.WaitGroup @@ -498,7 +527,7 @@ func TestAgentHeartbeat_Failed(t *testing.T) { func TestEmptyMessage(t *testing.T) { // Set up mock. - atl, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) + atl, _, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) defer cleanup() req := new(messagespb.VizierMessage) reqPb, err := req.Marshal() @@ -512,7 +541,7 @@ func TestEmptyMessage(t *testing.T) { func TestUnhandledMessage(t *testing.T) { // Set up mock. - atl, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) + atl, _, _, _, cleanup := setup(t, assertSendMessageUncalled(t)) defer cleanup() req := new(messagespb.VizierMessage) @@ -530,7 +559,7 @@ func TestUnhandledMessage(t *testing.T) { func TestAgentTracepointInfoUpdate(t *testing.T) { // Set up mock. - atl, _, mockTracepointStore, cleanup := setup(t, assertSendMessageUncalled(t)) + atl, _, mockTracepointStore, _, cleanup := setup(t, assertSendMessageUncalled(t)) defer cleanup() agentID := uuid.Must(uuid.NewV4()) @@ -567,6 +596,45 @@ func TestAgentTracepointInfoUpdate(t *testing.T) { require.NoError(t, err) } +func TestAgentFileSourceInfoUpdate(t *testing.T) { + // Set up mock. + atl, _, _, mockFileSourceStore, cleanup := setup(t, assertSendMessageUncalled(t)) + defer cleanup() + + agentID := uuid.Must(uuid.NewV4()) + tpID := uuid.Must(uuid.NewV4()) + + mockFileSourceStore. + EXPECT(). + UpdateFileSourceState(&storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tpID), + AgentID: utils.ProtoFromUUID(agentID), + State: statuspb.RUNNING_STATE, + }). + Return(nil) + + req := &messagespb.VizierMessage{ + Msg: &messagespb.VizierMessage_FileSourceMessage{ + FileSourceMessage: &messagespb.FileSourceMessage{ + Msg: &messagespb.FileSourceMessage_FileSourceInfoUpdate{ + FileSourceInfoUpdate: &messagespb.FileSourceInfoUpdate{ + ID: utils.ProtoFromUUID(tpID), + AgentID: utils.ProtoFromUUID(agentID), + State: statuspb.RUNNING_STATE, + }, + }, + }, + }, + } + reqPb, err := req.Marshal() + require.NoError(t, err) + + msg := nats.Msg{} + msg.Data = reqPb + err = atl.HandleMessage(&msg) + require.NoError(t, err) +} + func TestAgentStop(t *testing.T) { u, err := uuid.FromString(testutils.NewAgentUUID) require.NoError(t, err) @@ -581,7 +649,7 @@ func TestAgentStop(t *testing.T) { }) // Set up mock. - atl, _, _, cleanup := setup(t, sendMsg) + atl, _, _, _, cleanup := setup(t, sendMsg) defer cleanup() atl.StopAgent(u) diff --git a/src/vizier/services/metadata/controllers/file_source/BUILD.bazel b/src/vizier/services/metadata/controllers/file_source/BUILD.bazel new file mode 100644 index 00000000000..933a76e91a6 --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/BUILD.bazel @@ -0,0 +1,74 @@ +# Copyright 2018- The Pixie Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//bazel:pl_build_system.bzl", "pl_go_test") + +go_library( + name = "file_source", + srcs = [ + "file_source.go", + "file_source_store.go", + ], + importpath = "px.dev/pixie/src/vizier/services/metadata/controllers/file_source", + visibility = ["//src/vizier:__subpackages__"], + deps = [ + "//src/api/proto/uuidpb:uuid_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", + "//src/common/base/statuspb:status_pl_go_proto", + "//src/utils", + "//src/vizier/messages/messagespb:messages_pl_go_proto", + "//src/vizier/services/metadata/storepb:store_pl_go_proto", + "//src/vizier/services/shared/agentpb:agent_pl_go_proto", + "//src/vizier/utils/datastore", + "@com_github_gofrs_uuid//:uuid", + "@com_github_gogo_protobuf//proto", + "@com_github_gogo_protobuf//types", + "@com_github_sirupsen_logrus//:logrus", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_x_sync//errgroup", + ], +) + +pl_go_test( + name = "file_source_test", + srcs = [ + "file_source_store_test.go", + "file_source_test.go", + ], + embed = [":file_source"], + deps = [ + "//src/api/proto/uuidpb:uuid_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", + "//src/common/base/statuspb:status_pl_go_proto", + "//src/utils", + "//src/vizier/messages/messagespb:messages_pl_go_proto", + "//src/vizier/services/metadata/controllers/agent/mock", + "//src/vizier/services/metadata/controllers/file_source/mock", + "//src/vizier/services/metadata/storepb:store_pl_go_proto", + "//src/vizier/services/shared/agentpb:agent_pl_go_proto", + "//src/vizier/utils/datastore/pebbledb", + "@com_github_cockroachdb_pebble//:pebble", + "@com_github_cockroachdb_pebble//vfs", + "@com_github_gofrs_uuid//:uuid", + "@com_github_gogo_protobuf//proto", + "@com_github_gogo_protobuf//types", + "@com_github_golang_mock//gomock", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/src/vizier/services/metadata/controllers/file_source/file_source.go b/src/vizier/services/metadata/controllers/file_source/file_source.go new file mode 100644 index 00000000000..770476d1632 --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/file_source.go @@ -0,0 +1,375 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package file_source + +import ( + "errors" + "fmt" + "sync" + "time" + + "github.com/gofrs/uuid" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "px.dev/pixie/src/api/proto/uuidpb" + "px.dev/pixie/src/carnot/planner/file_source/ir" + "px.dev/pixie/src/common/base/statuspb" + "px.dev/pixie/src/utils" + "px.dev/pixie/src/vizier/messages/messagespb" + "px.dev/pixie/src/vizier/services/metadata/storepb" + "px.dev/pixie/src/vizier/services/shared/agentpb" +) + +var ( + // ErrFileSourceAlreadyExists is produced if a file_source already exists with the given name + // and does not have a matching schema. + ErrFileSourceAlreadyExists = errors.New("FileSource already exists") +) + +// agentMessenger is a controller that lets us message all agents and all active agents. +type agentMessenger interface { + MessageAgents(agentIDs []uuid.UUID, msg []byte) error + MessageActiveAgents(msg []byte) error +} + +// Store is a datastore which can store, update, and retrieve information about file_sources. +type Store interface { + UpsertFileSource(uuid.UUID, *storepb.FileSourceInfo) error + GetFileSource(uuid.UUID) (*storepb.FileSourceInfo, error) + GetFileSources() ([]*storepb.FileSourceInfo, error) + UpdateFileSourceState(*storepb.AgentFileSourceStatus) error + GetFileSourceStates(uuid.UUID) ([]*storepb.AgentFileSourceStatus, error) + SetFileSourceWithName(string, uuid.UUID) error + GetFileSourcesWithNames([]string) ([]*uuid.UUID, error) + GetFileSourcesForIDs([]uuid.UUID) ([]*storepb.FileSourceInfo, error) + SetFileSourceTTL(uuid.UUID, time.Duration) error + DeleteFileSourceTTLs([]uuid.UUID) error + DeleteFileSource(uuid.UUID) error + DeleteFileSourcesForAgent(uuid.UUID) error + GetFileSourceTTLs() ([]uuid.UUID, []time.Time, error) +} + +// Manager manages the file_sources deployed in the cluster. +type Manager struct { + ts Store + agtMgr agentMessenger + + done chan struct{} + once sync.Once +} + +// NewManager creates a new file_source manager. +func NewManager(ts Store, agtMgr agentMessenger, ttlReaperDuration time.Duration) *Manager { + tm := &Manager{ + ts: ts, + agtMgr: agtMgr, + done: make(chan struct{}), + } + + go tm.watchForFileSourceExpiry(ttlReaperDuration) + return tm +} + +func (m *Manager) watchForFileSourceExpiry(ttlReaperDuration time.Duration) { + ticker := time.NewTicker(ttlReaperDuration) + defer ticker.Stop() + for { + select { + case <-m.done: + return + case <-ticker.C: + m.terminateExpiredFileSources() + } + } +} + +func (m *Manager) terminateExpiredFileSources() { + fss, err := m.ts.GetFileSources() + if err != nil { + log.WithError(err).Warn("error encountered when trying to terminating expired file_sources") + return + } + + ttlKeys, ttlVals, err := m.ts.GetFileSourceTTLs() + if err != nil { + log.WithError(err).Warn("error encountered when trying to terminating expired file_sources") + return + } + + now := time.Now() + + // Lookup for file_sources that still have an active ttl + fsActive := make(map[uuid.UUID]bool) + for i, fs := range ttlKeys { + fsActive[fs] = ttlVals[i].After(now) + } + + for _, fs := range fss { + fsID := utils.UUIDFromProtoOrNil(fs.ID) + if fsActive[fsID] { + // FileSource TTL exists and is in the future + continue + } + if fs.ExpectedState == statuspb.TERMINATED_STATE { + // FileSource is already in terminated state + continue + } + err = m.terminateFileSource(fsID) + if err != nil { + log.WithError(err).Warn("error encountered when trying to terminating expired file_sources") + } + } +} + +func (m *Manager) terminateFileSource(id uuid.UUID) error { + // Update state in datastore to terminated. + fs, err := m.ts.GetFileSource(id) + if err != nil { + return err + } + + if fs == nil { + return nil + } + + fs.ExpectedState = statuspb.TERMINATED_STATE + err = m.ts.UpsertFileSource(id, fs) + if err != nil { + return err + } + + // Send termination messages to PEMs. + fileSourceReq := messagespb.VizierMessage{ + Msg: &messagespb.VizierMessage_FileSourceMessage{ + FileSourceMessage: &messagespb.FileSourceMessage{ + Msg: &messagespb.FileSourceMessage_RemoveFileSourceRequest{ + RemoveFileSourceRequest: &messagespb.RemoveFileSourceRequest{ + ID: utils.ProtoFromUUID(id), + }, + }, + }, + }, + } + msg, err := fileSourceReq.Marshal() + if err != nil { + return err + } + + return m.agtMgr.MessageActiveAgents(msg) +} + +func (m *Manager) deleteFileSource(id uuid.UUID) error { + return m.ts.DeleteFileSource(id) +} + +// CreateFileSource creates and stores info about the given file source. +func (m *Manager) CreateFileSource(fileSourceName string, fileSourceDeployment *ir.FileSourceDeployment) (*uuid.UUID, error) { + // Check to see if a file source with the matching name already exists. + resp, err := m.ts.GetFileSourcesWithNames([]string{fileSourceName}) + if err != nil { + return nil, err + } + + if len(resp) != 1 { + return nil, errors.New("Could not fetch fileSource") + } + prevFileSourceID := resp[0] + + ttl, err := types.DurationFromProto(fileSourceDeployment.TTL) + if err != nil { + return nil, status.Error(codes.Internal, fmt.Sprintf("Failed to parse duration: %+v", err)) + } + + if prevFileSourceID != nil { // Existing file source already exists. + prevFileSource, err := m.ts.GetFileSource(*prevFileSourceID) + if err != nil { + return nil, err + } + if prevFileSource != nil && prevFileSource.ExpectedState != statuspb.TERMINATED_STATE { + // If everything is exactly the same, no need to redeploy + // - return prevFileSourceID, ErrFileSourceAlreadyExists + // If anything inside file sources has changed + // - delete old file sources, and insert new file sources. + + // Check if the file sources are exactly the same. + allFsSame := true + if !proto.Equal(prevFileSource.FileSource, fileSourceDeployment) { + allFsSame = false + } + + if allFsSame { + err = m.ts.SetFileSourceTTL(*prevFileSourceID, ttl) + if err != nil { + return nil, err + } + return prevFileSourceID, ErrFileSourceAlreadyExists + } + + // Something has changed, so trigger termination of the old file source. + err = m.ts.DeleteFileSourceTTLs([]uuid.UUID{*prevFileSourceID}) + if err != nil { + return nil, err + } + } + } + + fsID, err := uuid.NewV4() + if err != nil { + return nil, err + } + newFileSource := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(fsID), + Name: fileSourceName, + FileSource: fileSourceDeployment, + ExpectedState: statuspb.RUNNING_STATE, + } + err = m.ts.UpsertFileSource(fsID, newFileSource) + if err != nil { + return nil, err + } + err = m.ts.SetFileSourceTTL(fsID, ttl) + if err != nil { + return nil, err + } + err = m.ts.SetFileSourceWithName(fileSourceName, fsID) + if err != nil { + return nil, err + } + return &fsID, nil +} + +// GetAllFileSources gets all the file sources currently tracked by the metadata service. +func (m *Manager) GetAllFileSources() ([]*storepb.FileSourceInfo, error) { + return m.ts.GetFileSources() +} + +// UpdateAgentFileSourceStatus updates the file source info with the new agent file source status. +func (m *Manager) UpdateAgentFileSourceStatus(fileSourceID *uuidpb.UUID, agentID *uuidpb.UUID, state statuspb.LifeCycleState, status *statuspb.Status) error { + if state == statuspb.TERMINATED_STATE { // If all agent file source statuses are now terminated, we can finally delete the file source from the datastore. + tID := utils.UUIDFromProtoOrNil(fileSourceID) + states, err := m.GetFileSourceStates(tID) + if err != nil { + return err + } + allTerminated := true + for _, s := range states { + if s.State != statuspb.TERMINATED_STATE && !s.AgentID.Equal(agentID) { + allTerminated = false + break + } + } + + if allTerminated { + return m.deleteFileSource(tID) + } + } + + fileSourceState := &storepb.AgentFileSourceStatus{ + State: state, + Status: status, + ID: fileSourceID, + AgentID: agentID, + } + + return m.ts.UpdateFileSourceState(fileSourceState) +} + +// RegisterFileSource sends requests to the given agents to register the specified file source. +func (m *Manager) RegisterFileSource(agents []*agentpb.Agent, fileSourceID uuid.UUID, fileSourceDeployment *ir.FileSourceDeployment) error { + agentIDs := make([]uuid.UUID, len(agents)) + fileSourceReq := messagespb.VizierMessage{ + Msg: &messagespb.VizierMessage_FileSourceMessage{ + FileSourceMessage: &messagespb.FileSourceMessage{ + Msg: &messagespb.FileSourceMessage_RegisterFileSourceRequest{ + RegisterFileSourceRequest: &messagespb.RegisterFileSourceRequest{ + FileSourceDeployment: fileSourceDeployment, + ID: utils.ProtoFromUUID(fileSourceID), + }, + }, + }, + }, + } + msg, err := fileSourceReq.Marshal() + if err != nil { + return err + } + for i, agt := range agents { + agentIDs[i] = utils.UUIDFromProtoOrNil(agt.Info.AgentID) + } + + err = m.agtMgr.MessageAgents(agentIDs, msg) + + if err != nil { + return err + } + + return nil +} + +// GetFileSourceInfo gets the status for the file source with the given ID. +func (m *Manager) GetFileSourceInfo(fileSourceID uuid.UUID) (*storepb.FileSourceInfo, error) { + return m.ts.GetFileSource(fileSourceID) +} + +// GetFileSourceStates gets all the known agent states for the given file source. +func (m *Manager) GetFileSourceStates(fileSourceID uuid.UUID) ([]*storepb.AgentFileSourceStatus, error) { + return m.ts.GetFileSourceStates(fileSourceID) +} + +// GetFileSourcesForIDs gets all the file source infos for the given ids. +func (m *Manager) GetFileSourcesForIDs(ids []uuid.UUID) ([]*storepb.FileSourceInfo, error) { + return m.ts.GetFileSourcesForIDs(ids) +} + +// RemoveFileSources starts the termination process for the file sources with the given names. +func (m *Manager) RemoveFileSources(names []string) error { + fsIDs, err := m.ts.GetFileSourcesWithNames(names) + if err != nil { + return err + } + + ids := make([]uuid.UUID, len(fsIDs)) + + for i, id := range fsIDs { + if id == nil { + return fmt.Errorf("Could not find file source for given name: %s", names[i]) + } + ids[i] = *id + } + + return m.ts.DeleteFileSourceTTLs(ids) +} + +// DeleteAgent deletes file sources on the given agent. +func (m *Manager) DeleteAgent(agentID uuid.UUID) error { + return m.ts.DeleteFileSourcesForAgent(agentID) +} + +// Close cleans up the goroutines created and renders this no longer useable. +func (m *Manager) Close() { + m.once.Do(func() { + close(m.done) + }) + m.ts = nil + m.agtMgr = nil +} diff --git a/src/vizier/services/metadata/controllers/file_source/file_source_store.go b/src/vizier/services/metadata/controllers/file_source/file_source_store.go new file mode 100644 index 00000000000..8ad9d729a0a --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/file_source_store.go @@ -0,0 +1,309 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package file_source + +import ( + "path" + "strings" + "time" + + "github.com/gofrs/uuid" + "github.com/gogo/protobuf/proto" + "golang.org/x/sync/errgroup" + + "px.dev/pixie/src/api/proto/uuidpb" + "px.dev/pixie/src/utils" + "px.dev/pixie/src/vizier/services/metadata/storepb" + "px.dev/pixie/src/vizier/utils/datastore" +) + +const ( + fileSourcesPrefix = "/fileSource/" + fileSourceStatesPrefix = "/fileSourceStates/" + fileSourceTTLsPrefix = "/fileSourceTTL/" + fileSourceNamesPrefix = "/fileSourceName/" +) + +// Datastore implements the FileSourceStore interface on a given Datastore. +type Datastore struct { + ds datastore.MultiGetterSetterDeleterCloser +} + +// NewDatastore wraps the datastore in a file source store +func NewDatastore(ds datastore.MultiGetterSetterDeleterCloser) *Datastore { + return &Datastore{ds: ds} +} + +func getFileSourceWithNameKey(fileSourceName string) string { + return path.Join(fileSourceNamesPrefix, fileSourceName) +} + +func getFileSourceKey(fileSourceID uuid.UUID) string { + return path.Join(fileSourcesPrefix, fileSourceID.String()) +} + +func getFileSourceStatesKey(fileSourceID uuid.UUID) string { + return path.Join(fileSourceStatesPrefix, fileSourceID.String()) +} + +func getFileSourceStateKey(fileSourceID uuid.UUID, agentID uuid.UUID) string { + return path.Join(fileSourceStatesPrefix, fileSourceID.String(), agentID.String()) +} + +func getFileSourceTTLKey(fileSourceID uuid.UUID) string { + return path.Join(fileSourceTTLsPrefix, fileSourceID.String()) +} + +// GetFileSourcesWithNames gets which file source is associated with the given name. +func (t *Datastore) GetFileSourcesWithNames(fileSourceNames []string) ([]*uuid.UUID, error) { + eg := errgroup.Group{} + ids := make([]*uuid.UUID, len(fileSourceNames)) + for i := 0; i < len(fileSourceNames); i++ { + i := i // Closure for goroutine + eg.Go(func() error { + val, err := t.ds.Get(getFileSourceWithNameKey(fileSourceNames[i])) + if err != nil { + return err + } + if val == nil { + return nil + } + uuidPB := &uuidpb.UUID{} + err = proto.Unmarshal(val, uuidPB) + if err != nil { + return err + } + id := utils.UUIDFromProtoOrNil(uuidPB) + ids[i] = &id + return nil + }) + } + err := eg.Wait() + if err != nil { + return nil, err + } + + return ids, nil +} + +// SetFileSourceWithName associates the file source with the given name with the one with the provided ID. +func (t *Datastore) SetFileSourceWithName(fileSourceName string, fileSourceID uuid.UUID) error { + fileSourceIDpb := utils.ProtoFromUUID(fileSourceID) + val, err := fileSourceIDpb.Marshal() + if err != nil { + return err + } + + return t.ds.Set(getFileSourceWithNameKey(fileSourceName), string(val)) +} + +// UpsertFileSource updates or creates a new file source entry in the store. +func (t *Datastore) UpsertFileSource(fileSourceID uuid.UUID, fileSourceInfo *storepb.FileSourceInfo) error { + val, err := fileSourceInfo.Marshal() + if err != nil { + return err + } + + return t.ds.Set(getFileSourceKey(fileSourceID), string(val)) +} + +// DeleteFileSource deletes the file source from the store. +func (t *Datastore) DeleteFileSource(fileSourceID uuid.UUID) error { + err := t.ds.DeleteAll([]string{getFileSourceKey(fileSourceID)}) + if err != nil { + return err + } + + return t.ds.DeleteWithPrefix(getFileSourceStatesKey(fileSourceID)) +} + +// GetFileSource gets the file source info from the store, if it exists. +func (t *Datastore) GetFileSource(fileSourceID uuid.UUID) (*storepb.FileSourceInfo, error) { + resp, err := t.ds.Get(getFileSourceKey(fileSourceID)) + if err != nil { + return nil, err + } + if resp == nil { + return nil, nil + } + + fileSourcePb := &storepb.FileSourceInfo{} + err = proto.Unmarshal(resp, fileSourcePb) + if err != nil { + return nil, err + } + return fileSourcePb, nil +} + +// GetFileSources gets all of the file source s in the store. +func (t *Datastore) GetFileSources() ([]*storepb.FileSourceInfo, error) { + _, vals, err := t.ds.GetWithPrefix(fileSourcesPrefix) + if err != nil { + return nil, err + } + + fileSources := make([]*storepb.FileSourceInfo, len(vals)) + for i, val := range vals { + pb := &storepb.FileSourceInfo{} + err := proto.Unmarshal(val, pb) + if err != nil { + continue + } + fileSources[i] = pb + } + return fileSources, nil +} + +// GetFileSourcesForIDs gets all of the file source s with the given it.ds. +func (t *Datastore) GetFileSourcesForIDs(ids []uuid.UUID) ([]*storepb.FileSourceInfo, error) { + eg := errgroup.Group{} + fileSources := make([]*storepb.FileSourceInfo, len(ids)) + for i := 0; i < len(ids); i++ { + i := i // Closure for goroutine + eg.Go(func() error { + val, err := t.ds.Get(getFileSourceKey(ids[i])) + if err != nil { + return err + } + if val == nil { + return nil + } + fs := &storepb.FileSourceInfo{} + err = proto.Unmarshal(val, fs) + if err != nil { + return err + } + fileSources[i] = fs + return nil + }) + } + + err := eg.Wait() + if err != nil { + return nil, err + } + + return fileSources, nil +} + +// UpdateFileSourceState updates the agent file source state in the store. +func (t *Datastore) UpdateFileSourceState(state *storepb.AgentFileSourceStatus) error { + val, err := state.Marshal() + if err != nil { + return err + } + + fsID := utils.UUIDFromProtoOrNil(state.ID) + + return t.ds.Set(getFileSourceStateKey(fsID, utils.UUIDFromProtoOrNil(state.AgentID)), string(val)) +} + +// GetFileSourceStates gets all the agentFileSource states for the given file source . +func (t *Datastore) GetFileSourceStates(fileSourceID uuid.UUID) ([]*storepb.AgentFileSourceStatus, error) { + _, vals, err := t.ds.GetWithPrefix(getFileSourceStatesKey(fileSourceID)) + if err != nil { + return nil, err + } + + fileSources := make([]*storepb.AgentFileSourceStatus, len(vals)) + for i, val := range vals { + pb := &storepb.AgentFileSourceStatus{} + err := proto.Unmarshal(val, pb) + if err != nil { + continue + } + fileSources[i] = pb + } + return fileSources, nil +} + +// SetFileSourceTTL creates a key in the datastore with the given TTL. This represents the amount of time +// that the given file source should be persisted before terminating. +func (t *Datastore) SetFileSourceTTL(fileSourceID uuid.UUID, ttl time.Duration) error { + expiresAt := time.Now().Add(ttl) + encodedExpiry, err := expiresAt.MarshalBinary() + if err != nil { + return err + } + return t.ds.SetWithTTL(getFileSourceTTLKey(fileSourceID), string(encodedExpiry), ttl) +} + +// DeleteFileSourceTTLs deletes the key in the datastore for the given file source TTLs. +// This is done as a single transaction, so if any deletes fail, they all fail. +func (t *Datastore) DeleteFileSourceTTLs(ids []uuid.UUID) error { + keys := make([]string, len(ids)) + for i, id := range ids { + keys[i] = getFileSourceTTLKey(id) + } + + return t.ds.DeleteAll(keys) +} + +// DeleteFileSourcesForAgent deletes the file source s for a given agent. +// Note this only purges the combo file source ID+agentID keys. Said +// file source s might still be valid and deployed on other agents. +func (t *Datastore) DeleteFileSourcesForAgent(agentID uuid.UUID) error { + fss, err := t.GetFileSources() + if err != nil { + return err + } + + delKeys := make([]string, len(fss)) + for i, fs := range fss { + delKeys[i] = getFileSourceStateKey(utils.UUIDFromProtoOrNil(fs.ID), agentID) + } + + return t.ds.DeleteAll(delKeys) +} + +// GetFileSourceTTLs gets the file source s which still have existing TTLs. +func (t *Datastore) GetFileSourceTTLs() ([]uuid.UUID, []time.Time, error) { + keys, vals, err := t.ds.GetWithPrefix(fileSourceTTLsPrefix) + if err != nil { + return nil, nil, err + } + + var ids []uuid.UUID + var expirations []time.Time + + for i, k := range keys { + keyParts := strings.Split(k, "/") + if len(keyParts) != 3 { + continue + } + id, err := uuid.FromString(keyParts[2]) + if err != nil { + continue + } + var expiresAt time.Time + err = expiresAt.UnmarshalBinary(vals[i]) + if err != nil { + // This shouldn't happen for new keys, but we might have added TTLs + // in the past without a value. So just pick some time sufficiently + // in the future. + // This value is only used to determine what file source s are expired + // as of _NOW_ so this is "safe". + expiresAt = time.Now().Add(30 * 24 * time.Hour) + } + ids = append(ids, id) + expirations = append(expirations, expiresAt) + } + + return ids, expirations, nil +} diff --git a/src/vizier/services/metadata/controllers/file_source/file_source_store_test.go b/src/vizier/services/metadata/controllers/file_source/file_source_store_test.go new file mode 100644 index 00000000000..f43caa8271e --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/file_source_store_test.go @@ -0,0 +1,364 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package file_source + +import ( + "os" + "testing" + "time" + + "github.com/cockroachdb/pebble" + "github.com/cockroachdb/pebble/vfs" + "github.com/gofrs/uuid" + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "px.dev/pixie/src/api/proto/uuidpb" + "px.dev/pixie/src/common/base/statuspb" + "px.dev/pixie/src/utils" + "px.dev/pixie/src/vizier/services/metadata/storepb" + "px.dev/pixie/src/vizier/utils/datastore/pebbledb" +) + +func setupTest(t *testing.T) (*pebbledb.DataStore, *Datastore, func()) { + memFS := vfs.NewMem() + c, err := pebble.Open("test", &pebble.Options{ + FS: memFS, + }) + if err != nil { + t.Fatal("failed to initialize a pebbledb") + os.Exit(1) + } + + db := pebbledb.New(c, 3*time.Second) + ts := NewDatastore(db) + cleanup := func() { + err := db.Close() + if err != nil { + t.Fatal("Failed to close db") + } + } + + return db, ts, cleanup +} + +func TestFileSourceStore_UpsertFileSource(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + // Create file sources. + s1 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(tpID), + } + + err := ts.UpsertFileSource(tpID, s1) + require.NoError(t, err) + + savedFileSource, err := db.Get("/fileSource/" + tpID.String()) + require.NoError(t, err) + savedFileSourcePb := &storepb.FileSourceInfo{} + err = proto.Unmarshal(savedFileSource, savedFileSourcePb) + require.NoError(t, err) + assert.Equal(t, s1, savedFileSourcePb) +} + +func TestFileSourceStore_GetFileSource(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + // Create file sources. + s1 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(tpID), + } + s1Text, err := s1.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + err = db.Set("/fileSource/"+tpID.String(), string(s1Text)) + require.NoError(t, err) + + fileSource, err := ts.GetFileSource(tpID) + require.NoError(t, err) + assert.NotNil(t, fileSource) + + assert.Equal(t, s1.ID, fileSource.ID) +} + +func TestFileSourceStore_GetFileSources(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + // Create file sources. + s1ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c8") + s1 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(s1ID), + } + s1Text, err := s1.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + s2ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c9") + s2 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(s2ID), + } + s2Text, err := s2.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + err = db.Set("/fileSource/"+s1ID.String(), string(s1Text)) + require.NoError(t, err) + err = db.Set("/fileSource/"+s2ID.String(), string(s2Text)) + require.NoError(t, err) + + fileSources, err := ts.GetFileSources() + require.NoError(t, err) + assert.Equal(t, 2, len(fileSources)) + + ids := make([]string, len(fileSources)) + for i, tp := range fileSources { + ids[i] = utils.ProtoToUUIDStr(tp.ID) + } + + assert.Contains(t, ids, utils.ProtoToUUIDStr(s1.ID)) + assert.Contains(t, ids, utils.ProtoToUUIDStr(s2.ID)) +} + +func TestFileSourceStore_GetFileSourcesForIDs(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + // Create file sources. + s1ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c8") + s1 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(s1ID), + } + s1Text, err := s1.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + s2ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c9") + s2 := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(s2ID), + } + s2Text, err := s2.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + s3ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c7") + + err = db.Set("/fileSource/"+s1ID.String(), string(s1Text)) + require.NoError(t, err) + err = db.Set("/fileSource/"+s2ID.String(), string(s2Text)) + require.NoError(t, err) + + fileSources, err := ts.GetFileSourcesForIDs([]uuid.UUID{s1ID, s2ID, s3ID}) + require.NoError(t, err) + assert.Equal(t, 3, len(fileSources)) + + ids := make([]string, len(fileSources)) + for i, tp := range fileSources { + if tp == nil || tp.ID == nil { + continue + } + ids[i] = utils.ProtoToUUIDStr(tp.ID) + } + + assert.Contains(t, ids, utils.ProtoToUUIDStr(s1.ID)) + assert.Contains(t, ids, utils.ProtoToUUIDStr(s2.ID)) +} + +func TestFileSourceStore_UpdateFileSourceState(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + agentID := uuid.Must(uuid.NewV4()) + tpID := uuid.Must(uuid.NewV4()) + // Create file source state + s1 := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tpID), + AgentID: utils.ProtoFromUUID(agentID), + State: statuspb.RUNNING_STATE, + } + + err := ts.UpdateFileSourceState(s1) + require.NoError(t, err) + + savedFileSource, err := db.Get("/fileSourceStates/" + tpID.String() + "/" + agentID.String()) + require.NoError(t, err) + savedFileSourcePb := &storepb.AgentFileSourceStatus{} + err = proto.Unmarshal(savedFileSource, savedFileSourcePb) + require.NoError(t, err) + assert.Equal(t, s1, savedFileSourcePb) +} + +func TestFileSourceStore_GetFileSourceStates(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + + agentID1 := uuid.FromStringOrNil("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + agentID2 := uuid.FromStringOrNil("6ba7b810-9dad-11d1-80b4-00c04fd430c9") + + // Create file sources. + s1 := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tpID), + AgentID: utils.ProtoFromUUID(agentID1), + State: statuspb.RUNNING_STATE, + } + s1Text, err := s1.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + s2 := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tpID), + AgentID: utils.ProtoFromUUID(agentID2), + State: statuspb.PENDING_STATE, + } + s2Text, err := s2.Marshal() + if err != nil { + t.Fatal("Unable to marshal file source pb") + } + + err = db.Set("/fileSourceStates/"+tpID.String()+"/"+agentID1.String(), string(s1Text)) + require.NoError(t, err) + err = db.Set("/fileSourceStates/"+tpID.String()+"/"+agentID2.String(), string(s2Text)) + require.NoError(t, err) + + fileSources, err := ts.GetFileSourceStates(tpID) + require.NoError(t, err) + assert.Equal(t, 2, len(fileSources)) + + agentIDs := make([]string, len(fileSources)) + for i, tp := range fileSources { + agentIDs[i] = utils.ProtoToUUIDStr(tp.AgentID) + } + + assert.Contains(t, agentIDs, utils.ProtoToUUIDStr(s1.AgentID)) + assert.Contains(t, agentIDs, utils.ProtoToUUIDStr(s2.AgentID)) +} + +func TestFileSourceStore_SetFileSourceWithName(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + + err := ts.SetFileSourceWithName("test", tpID) + require.NoError(t, err) + + savedFileSource, err := db.Get("/fileSourceName/test") + require.NoError(t, err) + savedFileSourcePb := &uuidpb.UUID{} + err = proto.Unmarshal(savedFileSource, savedFileSourcePb) + require.NoError(t, err) + assert.Equal(t, tpID, utils.UUIDFromProtoOrNil(savedFileSourcePb)) +} + +func TestFileSourceStore_GetFileSourcesWithNames(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + fileSourceIDpb := utils.ProtoFromUUID(tpID) + val, err := fileSourceIDpb.Marshal() + require.NoError(t, err) + + tpID2 := uuid.Must(uuid.NewV4()) + fileSourceIDpb2 := utils.ProtoFromUUID(tpID2) + val2, err := fileSourceIDpb2.Marshal() + require.NoError(t, err) + + err = db.Set("/fileSourceName/test", string(val)) + require.NoError(t, err) + err = db.Set("/fileSourceName/test2", string(val2)) + require.NoError(t, err) + + fileSources, err := ts.GetFileSourcesWithNames([]string{"test", "test2"}) + require.NoError(t, err) + assert.Equal(t, 2, len(fileSources)) + + tps := make([]string, len(fileSources)) + for i, tp := range fileSources { + tps[i] = tp.String() + } + + assert.Contains(t, tps, tpID.String()) + assert.Contains(t, tps, tpID2.String()) +} + +func TestFileSourceStore_DeleteFileSource(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + + err := db.Set("/fileSource/"+tpID.String(), "test") + require.NoError(t, err) + + err = ts.DeleteFileSource(tpID) + require.NoError(t, err) + + val, err := db.Get("/fileSource/" + tpID.String()) + require.NoError(t, err) + assert.Nil(t, val) +} + +func TestFileSourceStore_DeleteFileSourceTTLs(t *testing.T) { + _, ts, cleanup := setupTest(t) + defer cleanup() + + tpID := uuid.Must(uuid.NewV4()) + tpID2 := uuid.Must(uuid.NewV4()) + + err := ts.DeleteFileSourceTTLs([]uuid.UUID{tpID, tpID2}) + require.NoError(t, err) +} + +func TestFileSourceStore_GetFileSourceTTLs(t *testing.T) { + db, ts, cleanup := setupTest(t) + defer cleanup() + + // Create file sources. + s1ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c8") + s2ID := uuid.FromStringOrNil("8ba7b810-9dad-11d1-80b4-00c04fd430c9") + + err := db.Set("/fileSourceTTL/"+s1ID.String(), "") + require.NoError(t, err) + err = db.Set("/fileSourceTTL/"+s2ID.String(), "") + require.NoError(t, err) + err = db.Set("/fileSourceTTL/invalid", "") + require.NoError(t, err) + + fileSources, _, err := ts.GetFileSourceTTLs() + require.NoError(t, err) + assert.Equal(t, 2, len(fileSources)) + + assert.Contains(t, fileSources, s1ID) + assert.Contains(t, fileSources, s2ID) +} diff --git a/src/vizier/services/metadata/controllers/file_source/file_source_test.go b/src/vizier/services/metadata/controllers/file_source/file_source_test.go new file mode 100644 index 00000000000..f6ac693bca1 --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/file_source_test.go @@ -0,0 +1,528 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package file_source_test + +import ( + "sync" + "testing" + "time" + + "github.com/gofrs/uuid" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "px.dev/pixie/src/carnot/planner/file_source/ir" + "px.dev/pixie/src/common/base/statuspb" + "px.dev/pixie/src/utils" + "px.dev/pixie/src/vizier/messages/messagespb" + mock_agent "px.dev/pixie/src/vizier/services/metadata/controllers/agent/mock" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" + mock_file_source "px.dev/pixie/src/vizier/services/metadata/controllers/file_source/mock" + "px.dev/pixie/src/vizier/services/metadata/storepb" + "px.dev/pixie/src/vizier/services/shared/agentpb" +) + +func TestCreateFileSource(t *testing.T) { + tests := []struct { + name string + originalFileSource *ir.FileSourceDeployment + originalFileSourceState statuspb.LifeCycleState + newFileSource *ir.FileSourceDeployment + expectError bool + expectOldUpdated bool + expectTTLUpdateOnly bool + }{ + { + name: "test_file_source", + originalFileSource: nil, + newFileSource: &ir.FileSourceDeployment{ + GlobPattern: "/tmp/test", + TableName: "/tmp/test", + TTL: &types.Duration{ + Seconds: 5, + }, + }, + expectError: false, + }, + { + name: "existing file source match", + originalFileSource: &ir.FileSourceDeployment{ + GlobPattern: "/tmp/test", + TableName: "/tmp/test", + TTL: &types.Duration{ + Seconds: 5, + }, + }, + originalFileSourceState: statuspb.RUNNING_STATE, + newFileSource: &ir.FileSourceDeployment{ + GlobPattern: "/tmp/test", + TableName: "/tmp/test", + TTL: &types.Duration{ + Seconds: 5, + }, + }, + expectTTLUpdateOnly: true, + }, + { + name: "existing file source, not exactly the same (1)", + originalFileSource: &ir.FileSourceDeployment{ + GlobPattern: "/tmp/test", + TableName: "/tmp/test", + TTL: &types.Duration{ + Seconds: 5, + }, + }, + originalFileSourceState: statuspb.RUNNING_STATE, + newFileSource: &ir.FileSourceDeployment{ + GlobPattern: "/tmp/test.json", + TableName: "/tmp/test", + TTL: &types.Duration{ + Seconds: 5, + }, + }, + expectOldUpdated: true, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + origID := uuid.Must(uuid.NewV4()) + + if test.originalFileSource == nil { + mockFileSourceStore. + EXPECT(). + GetFileSourcesWithNames([]string{"test_file_source"}). + Return([]*uuid.UUID{nil}, nil) + } else { + mockFileSourceStore. + EXPECT(). + GetFileSourcesWithNames([]string{"test_file_source"}). + Return([]*uuid.UUID{&origID}, nil) + mockFileSourceStore. + EXPECT(). + GetFileSource(origID). + Return(&storepb.FileSourceInfo{ + ExpectedState: test.originalFileSourceState, + FileSource: test.originalFileSource, + }, nil) + } + + if test.expectTTLUpdateOnly { + mockFileSourceStore. + EXPECT(). + SetFileSourceTTL(origID, time.Second*5) + } + + if test.expectOldUpdated { + mockFileSourceStore. + EXPECT(). + DeleteFileSourceTTLs([]uuid.UUID{origID}). + Return(nil) + } + + var newID uuid.UUID + + if !test.expectError && !test.expectTTLUpdateOnly { + mockFileSourceStore. + EXPECT(). + UpsertFileSource(gomock.Any(), gomock.Any()). + DoAndReturn(func(id uuid.UUID, tpInfo *storepb.FileSourceInfo) error { + newID = id + assert.Equal(t, &storepb.FileSourceInfo{ + FileSource: test.newFileSource, + Name: "test_file_source", + ID: utils.ProtoFromUUID(id), + ExpectedState: statuspb.RUNNING_STATE, + }, tpInfo) + return nil + }) + + mockFileSourceStore. + EXPECT(). + SetFileSourceWithName("test_file_source", gomock.Any()). + DoAndReturn(func(name string, id uuid.UUID) error { + assert.Equal(t, newID, id) + return nil + }) + + mockFileSourceStore. + EXPECT(). + SetFileSourceTTL(gomock.Any(), time.Second*5). + DoAndReturn(func(id uuid.UUID, ttl time.Duration) error { + assert.Equal(t, newID, id) + return nil + }) + } + + mockAgtMgr := mock_agent.NewMockManager(ctrl) + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + actualFsID, err := fileSourceMgr.CreateFileSource("test_file_source", test.newFileSource) + if test.expectError || test.expectTTLUpdateOnly { + assert.Equal(t, file_source.ErrFileSourceAlreadyExists, err) + } else { + require.NoError(t, err) + assert.Equal(t, &newID, actualFsID) + } + }) + } +} + +func TestGetFileSources(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + tID1 := uuid.Must(uuid.NewV4()) + tID2 := uuid.Must(uuid.NewV4()) + expectedFileSourceInfo := []*storepb.FileSourceInfo{ + { + ID: utils.ProtoFromUUID(tID1), + }, + { + ID: utils.ProtoFromUUID(tID2), + }, + } + + mockFileSourceStore. + EXPECT(). + GetFileSources(). + Return(expectedFileSourceInfo, nil) + + fileSources, err := fileSourceMgr.GetAllFileSources() + require.NoError(t, err) + assert.Equal(t, expectedFileSourceInfo, fileSources) +} + +func TestGetFileSourceInfo(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + fsID1 := uuid.Must(uuid.NewV4()) + expectedFileSourceInfo := &storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(fsID1), + } + + mockFileSourceStore. + EXPECT(). + GetFileSource(fsID1). + Return(expectedFileSourceInfo, nil) + + fileSources, err := fileSourceMgr.GetFileSourceInfo(fsID1) + require.NoError(t, err) + assert.Equal(t, expectedFileSourceInfo, fileSources) +} + +func TestGetFileSourceStates(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + agentUUID1 := uuid.Must(uuid.NewV4()) + tID1 := uuid.Must(uuid.NewV4()) + expectedFileSourceStatus1 := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tID1), + AgentID: utils.ProtoFromUUID(agentUUID1), + State: statuspb.RUNNING_STATE, + } + + agentUUID2 := uuid.Must(uuid.NewV4()) + expectedFileSourceStatus2 := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(tID1), + AgentID: utils.ProtoFromUUID(agentUUID2), + State: statuspb.PENDING_STATE, + } + + mockFileSourceStore. + EXPECT(). + GetFileSourceStates(tID1). + Return([]*storepb.AgentFileSourceStatus{expectedFileSourceStatus1, expectedFileSourceStatus2}, nil) + + fileSources, err := fileSourceMgr.GetFileSourceStates(tID1) + require.NoError(t, err) + assert.Equal(t, expectedFileSourceStatus1, fileSources[0]) + assert.Equal(t, expectedFileSourceStatus2, fileSources[1]) +} + +func TestRegisterFileSource(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + agentUUID1 := uuid.Must(uuid.NewV4()) + agentUUID2 := uuid.Must(uuid.NewV4()) + upb1 := utils.ProtoFromUUID(agentUUID1) + upb2 := utils.ProtoFromUUID(agentUUID2) + mockAgents := []*agentpb.Agent{ + // Should match programUpTo5.18.0 and programFrom5.10.0To5.18.0 + { + Info: &agentpb.AgentInfo{ + AgentID: upb1, + }, + }, + { + Info: &agentpb.AgentInfo{ + AgentID: upb2, + }, + }, + } + + fileSourceID := uuid.Must(uuid.NewV4()) + fileSourceDeployment := &ir.FileSourceDeployment{} + expectedFileSourceReq := messagespb.VizierMessage{ + Msg: &messagespb.VizierMessage_FileSourceMessage{ + FileSourceMessage: &messagespb.FileSourceMessage{ + Msg: &messagespb.FileSourceMessage_RegisterFileSourceRequest{ + RegisterFileSourceRequest: &messagespb.RegisterFileSourceRequest{ + FileSourceDeployment: fileSourceDeployment, + ID: utils.ProtoFromUUID(fileSourceID), + }, + }, + }, + }, + } + // Serialize file source request proto into byte slice to compare with the actual message sent to agents. + msg1, err := expectedFileSourceReq.Marshal() + if err != nil { + t.Fatal(err) + } + + mockAgtMgr. + EXPECT(). + MessageAgents([]uuid.UUID{agentUUID1, agentUUID2}, msg1). + Return(nil) + + err = fileSourceMgr.RegisterFileSource(mockAgents, fileSourceID, fileSourceDeployment) + require.NoError(t, err) +} + +func TestUpdateAgentFileSourceStatus(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + agentUUID1 := uuid.Must(uuid.NewV4()) + fsID := uuid.Must(uuid.NewV4()) + expectedFileSourceState := &storepb.AgentFileSourceStatus{ + ID: utils.ProtoFromUUID(fsID), + AgentID: utils.ProtoFromUUID(agentUUID1), + State: statuspb.RUNNING_STATE, + } + + mockFileSourceStore. + EXPECT(). + UpdateFileSourceState(expectedFileSourceState). + Return(nil) + + err := fileSourceMgr.UpdateAgentFileSourceStatus(utils.ProtoFromUUID(fsID), utils.ProtoFromUUID(agentUUID1), statuspb.RUNNING_STATE, nil) + require.NoError(t, err) +} + +func TestUpdateAgentFileSourceStatus_Terminated(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + agentUUID1 := uuid.Must(uuid.NewV4()) + fsID := uuid.Must(uuid.NewV4()) + agentUUID2 := uuid.Must(uuid.NewV4()) + + mockFileSourceStore. + EXPECT(). + GetFileSourceStates(fsID). + Return([]*storepb.AgentFileSourceStatus{ + {AgentID: utils.ProtoFromUUID(agentUUID1), State: statuspb.TERMINATED_STATE}, + {AgentID: utils.ProtoFromUUID(agentUUID2), State: statuspb.RUNNING_STATE}, + }, nil) + + mockFileSourceStore. + EXPECT(). + DeleteFileSource(fsID). + Return(nil) + + err := fileSourceMgr.UpdateAgentFileSourceStatus(utils.ProtoFromUUID(fsID), utils.ProtoFromUUID(agentUUID2), statuspb.TERMINATED_STATE, nil) + require.NoError(t, err) +} + +func TestTTLExpiration(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + defer fileSourceMgr.Close() + + agentUUID1 := uuid.Must(uuid.NewV4()) + fsID := uuid.Must(uuid.NewV4()) + agentUUID2 := uuid.Must(uuid.NewV4()) + + mockFileSourceStore. + EXPECT(). + GetFileSourceStates(fsID). + Return([]*storepb.AgentFileSourceStatus{ + {AgentID: utils.ProtoFromUUID(agentUUID1), State: statuspb.TERMINATED_STATE}, + {AgentID: utils.ProtoFromUUID(agentUUID2), State: statuspb.RUNNING_STATE}, + }, nil) + + mockFileSourceStore. + EXPECT(). + DeleteFileSource(fsID). + Return(nil) + + err := fileSourceMgr.UpdateAgentFileSourceStatus(utils.ProtoFromUUID(fsID), utils.ProtoFromUUID(agentUUID2), statuspb.TERMINATED_STATE, nil) + require.NoError(t, err) +} + +func TestUpdateAgentFileSourceStatus_RemoveFileSources(t *testing.T) { + // Set up mock. + ctrl := gomock.NewController(t) + defer ctrl.Finish() + mockAgtMgr := mock_agent.NewMockManager(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + + fsID1 := uuid.Must(uuid.NewV4()) + fsID2 := uuid.Must(uuid.NewV4()) + fsID3 := uuid.Must(uuid.NewV4()) + fsID4 := uuid.Must(uuid.NewV4()) + + mockFileSourceStore. + EXPECT(). + GetFileSources(). + Return([]*storepb.FileSourceInfo{ + { + ID: utils.ProtoFromUUID(fsID1), + }, + { + ID: utils.ProtoFromUUID(fsID2), + }, + { + ID: utils.ProtoFromUUID(fsID3), + }, + { + ID: utils.ProtoFromUUID(fsID4), + ExpectedState: statuspb.TERMINATED_STATE, + }, + }, nil) + + mockFileSourceStore. + EXPECT(). + GetFileSourceTTLs(). + Return([]uuid.UUID{ + fsID1, + fsID3, + fsID4, + }, []time.Time{ + time.Now().Add(1 * time.Hour), + time.Now().Add(-1 * time.Minute), + time.Now().Add(-1 * time.Hour), + }, nil) + + mockFileSourceStore. + EXPECT(). + GetFileSource(fsID2). + Return(&storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(fsID2), + }, nil) + + mockFileSourceStore. + EXPECT(). + GetFileSource(fsID3). + Return(&storepb.FileSourceInfo{ + ID: utils.ProtoFromUUID(fsID3), + }, nil) + + mockFileSourceStore. + EXPECT(). + UpsertFileSource(fsID2, &storepb.FileSourceInfo{ID: utils.ProtoFromUUID(fsID2), ExpectedState: statuspb.TERMINATED_STATE}). + Return(nil) + + mockFileSourceStore. + EXPECT(). + UpsertFileSource(fsID3, &storepb.FileSourceInfo{ID: utils.ProtoFromUUID(fsID3), ExpectedState: statuspb.TERMINATED_STATE}). + Return(nil) + + var wg sync.WaitGroup + wg.Add(2) + + var seenDeletions []string + msgHandler := func(msg []byte) error { + vzMsg := &messagespb.VizierMessage{} + err := proto.Unmarshal(msg, vzMsg) + require.NoError(t, err) + req := vzMsg.GetFileSourceMessage().GetRemoveFileSourceRequest() + assert.NotNil(t, req) + seenDeletions = append(seenDeletions, utils.ProtoToUUIDStr(req.ID)) + + wg.Done() + return nil + } + + mockAgtMgr. + EXPECT(). + MessageActiveAgents(gomock.Any()). + Times(2). + DoAndReturn(msgHandler) + + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 25*time.Millisecond) + defer fileSourceMgr.Close() + + wg.Wait() + assert.Contains(t, seenDeletions, fsID2.String()) + assert.Contains(t, seenDeletions, fsID3.String()) +} diff --git a/src/vizier/services/metadata/controllers/file_source/mock.go b/src/vizier/services/metadata/controllers/file_source/mock.go new file mode 100644 index 00000000000..d0ccdbec1e2 --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/mock.go @@ -0,0 +1,21 @@ +/* + * Copyright 2018- The Pixie Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package file_source + +//go:generate mockgen -source=file_source.go -destination=mock/mock_file_source.gen.go Store diff --git a/src/vizier/services/metadata/controllers/file_source/mock/BUILD.bazel b/src/vizier/services/metadata/controllers/file_source/mock/BUILD.bazel new file mode 100644 index 00000000000..fd215aac86e --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/mock/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2018- The Pixie Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "mock", + srcs = ["mock_file_source.gen.go"], + importpath = "px.dev/pixie/src/vizier/services/metadata/controllers/file_source/mock", + visibility = ["//src/vizier:__subpackages__"], + deps = [ + "//src/vizier/services/metadata/storepb:store_pl_go_proto", + "@com_github_gofrs_uuid//:uuid", + "@com_github_golang_mock//gomock", + ], +) diff --git a/src/vizier/services/metadata/controllers/file_source/mock/mock_file_source.gen.go b/src/vizier/services/metadata/controllers/file_source/mock/mock_file_source.gen.go new file mode 100644 index 00000000000..9ce88669a98 --- /dev/null +++ b/src/vizier/services/metadata/controllers/file_source/mock/mock_file_source.gen.go @@ -0,0 +1,277 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: file_source.go + +// Package mock_file_source is a generated GoMock package. +package mock_file_source + +import ( + reflect "reflect" + time "time" + + uuid "github.com/gofrs/uuid" + gomock "github.com/golang/mock/gomock" + storepb "px.dev/pixie/src/vizier/services/metadata/storepb" +) + +// MockagentMessenger is a mock of agentMessenger interface. +type MockagentMessenger struct { + ctrl *gomock.Controller + recorder *MockagentMessengerMockRecorder +} + +// MockagentMessengerMockRecorder is the mock recorder for MockagentMessenger. +type MockagentMessengerMockRecorder struct { + mock *MockagentMessenger +} + +// NewMockagentMessenger creates a new mock instance. +func NewMockagentMessenger(ctrl *gomock.Controller) *MockagentMessenger { + mock := &MockagentMessenger{ctrl: ctrl} + mock.recorder = &MockagentMessengerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockagentMessenger) EXPECT() *MockagentMessengerMockRecorder { + return m.recorder +} + +// MessageActiveAgents mocks base method. +func (m *MockagentMessenger) MessageActiveAgents(msg []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessageActiveAgents", msg) + ret0, _ := ret[0].(error) + return ret0 +} + +// MessageActiveAgents indicates an expected call of MessageActiveAgents. +func (mr *MockagentMessengerMockRecorder) MessageActiveAgents(msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageActiveAgents", reflect.TypeOf((*MockagentMessenger)(nil).MessageActiveAgents), msg) +} + +// MessageAgents mocks base method. +func (m *MockagentMessenger) MessageAgents(agentIDs []uuid.UUID, msg []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessageAgents", agentIDs, msg) + ret0, _ := ret[0].(error) + return ret0 +} + +// MessageAgents indicates an expected call of MessageAgents. +func (mr *MockagentMessengerMockRecorder) MessageAgents(agentIDs, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageAgents", reflect.TypeOf((*MockagentMessenger)(nil).MessageAgents), agentIDs, msg) +} + +// MockStore is a mock of Store interface. +type MockStore struct { + ctrl *gomock.Controller + recorder *MockStoreMockRecorder +} + +// MockStoreMockRecorder is the mock recorder for MockStore. +type MockStoreMockRecorder struct { + mock *MockStore +} + +// NewMockStore creates a new mock instance. +func NewMockStore(ctrl *gomock.Controller) *MockStore { + mock := &MockStore{ctrl: ctrl} + mock.recorder = &MockStoreMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStore) EXPECT() *MockStoreMockRecorder { + return m.recorder +} + +// DeleteFileSource mocks base method. +func (m *MockStore) DeleteFileSource(arg0 uuid.UUID) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFileSource", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteFileSource indicates an expected call of DeleteFileSource. +func (mr *MockStoreMockRecorder) DeleteFileSource(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFileSource", reflect.TypeOf((*MockStore)(nil).DeleteFileSource), arg0) +} + +// DeleteFileSourceTTLs mocks base method. +func (m *MockStore) DeleteFileSourceTTLs(arg0 []uuid.UUID) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFileSourceTTLs", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteFileSourceTTLs indicates an expected call of DeleteFileSourceTTLs. +func (mr *MockStoreMockRecorder) DeleteFileSourceTTLs(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFileSourceTTLs", reflect.TypeOf((*MockStore)(nil).DeleteFileSourceTTLs), arg0) +} + +// DeleteFileSourcesForAgent mocks base method. +func (m *MockStore) DeleteFileSourcesForAgent(arg0 uuid.UUID) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFileSourcesForAgent", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteFileSourcesForAgent indicates an expected call of DeleteFileSourcesForAgent. +func (mr *MockStoreMockRecorder) DeleteFileSourcesForAgent(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFileSourcesForAgent", reflect.TypeOf((*MockStore)(nil).DeleteFileSourcesForAgent), arg0) +} + +// GetFileSource mocks base method. +func (m *MockStore) GetFileSource(arg0 uuid.UUID) (*storepb.FileSourceInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSource", arg0) + ret0, _ := ret[0].(*storepb.FileSourceInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFileSource indicates an expected call of GetFileSource. +func (mr *MockStoreMockRecorder) GetFileSource(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSource", reflect.TypeOf((*MockStore)(nil).GetFileSource), arg0) +} + +// GetFileSourceStates mocks base method. +func (m *MockStore) GetFileSourceStates(arg0 uuid.UUID) ([]*storepb.AgentFileSourceStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSourceStates", arg0) + ret0, _ := ret[0].([]*storepb.AgentFileSourceStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFileSourceStates indicates an expected call of GetFileSourceStates. +func (mr *MockStoreMockRecorder) GetFileSourceStates(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSourceStates", reflect.TypeOf((*MockStore)(nil).GetFileSourceStates), arg0) +} + +// GetFileSourceTTLs mocks base method. +func (m *MockStore) GetFileSourceTTLs() ([]uuid.UUID, []time.Time, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSourceTTLs") + ret0, _ := ret[0].([]uuid.UUID) + ret1, _ := ret[1].([]time.Time) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetFileSourceTTLs indicates an expected call of GetFileSourceTTLs. +func (mr *MockStoreMockRecorder) GetFileSourceTTLs() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSourceTTLs", reflect.TypeOf((*MockStore)(nil).GetFileSourceTTLs)) +} + +// GetFileSources mocks base method. +func (m *MockStore) GetFileSources() ([]*storepb.FileSourceInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSources") + ret0, _ := ret[0].([]*storepb.FileSourceInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFileSources indicates an expected call of GetFileSources. +func (mr *MockStoreMockRecorder) GetFileSources() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSources", reflect.TypeOf((*MockStore)(nil).GetFileSources)) +} + +// GetFileSourcesForIDs mocks base method. +func (m *MockStore) GetFileSourcesForIDs(arg0 []uuid.UUID) ([]*storepb.FileSourceInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSourcesForIDs", arg0) + ret0, _ := ret[0].([]*storepb.FileSourceInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFileSourcesForIDs indicates an expected call of GetFileSourcesForIDs. +func (mr *MockStoreMockRecorder) GetFileSourcesForIDs(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSourcesForIDs", reflect.TypeOf((*MockStore)(nil).GetFileSourcesForIDs), arg0) +} + +// GetFileSourcesWithNames mocks base method. +func (m *MockStore) GetFileSourcesWithNames(arg0 []string) ([]*uuid.UUID, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFileSourcesWithNames", arg0) + ret0, _ := ret[0].([]*uuid.UUID) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFileSourcesWithNames indicates an expected call of GetFileSourcesWithNames. +func (mr *MockStoreMockRecorder) GetFileSourcesWithNames(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFileSourcesWithNames", reflect.TypeOf((*MockStore)(nil).GetFileSourcesWithNames), arg0) +} + +// SetFileSourceTTL mocks base method. +func (m *MockStore) SetFileSourceTTL(arg0 uuid.UUID, arg1 time.Duration) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetFileSourceTTL", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetFileSourceTTL indicates an expected call of SetFileSourceTTL. +func (mr *MockStoreMockRecorder) SetFileSourceTTL(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFileSourceTTL", reflect.TypeOf((*MockStore)(nil).SetFileSourceTTL), arg0, arg1) +} + +// SetFileSourceWithName mocks base method. +func (m *MockStore) SetFileSourceWithName(arg0 string, arg1 uuid.UUID) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetFileSourceWithName", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetFileSourceWithName indicates an expected call of SetFileSourceWithName. +func (mr *MockStoreMockRecorder) SetFileSourceWithName(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFileSourceWithName", reflect.TypeOf((*MockStore)(nil).SetFileSourceWithName), arg0, arg1) +} + +// UpdateFileSourceState mocks base method. +func (m *MockStore) UpdateFileSourceState(arg0 *storepb.AgentFileSourceStatus) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateFileSourceState", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateFileSourceState indicates an expected call of UpdateFileSourceState. +func (mr *MockStoreMockRecorder) UpdateFileSourceState(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateFileSourceState", reflect.TypeOf((*MockStore)(nil).UpdateFileSourceState), arg0) +} + +// UpsertFileSource mocks base method. +func (m *MockStore) UpsertFileSource(arg0 uuid.UUID, arg1 *storepb.FileSourceInfo) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpsertFileSource", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertFileSource indicates an expected call of UpsertFileSource. +func (mr *MockStoreMockRecorder) UpsertFileSource(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertFileSource", reflect.TypeOf((*MockStore)(nil).UpsertFileSource), arg0, arg1) +} diff --git a/src/vizier/services/metadata/controllers/message_bus.go b/src/vizier/services/metadata/controllers/message_bus.go index fafee905dbc..2a2be881592 100644 --- a/src/vizier/services/metadata/controllers/message_bus.go +++ b/src/vizier/services/metadata/controllers/message_bus.go @@ -23,6 +23,7 @@ import ( log "github.com/sirupsen/logrus" "px.dev/pixie/src/vizier/services/metadata/controllers/agent" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" "px.dev/pixie/src/vizier/services/metadata/controllers/k8smeta" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" ) @@ -52,9 +53,8 @@ type MessageBusController struct { // NewMessageBusController creates a new controller for handling NATS messages. func NewMessageBusController(conn *nats.Conn, agtMgr agent.Manager, - tpMgr *tracepoint.Manager, k8smetaHandler *k8smeta.Handler, - isLeader *bool, -) (*MessageBusController, error) { + tpMgr *tracepoint.Manager, fsMgr *file_source.Manager, k8smetaHandler *k8smeta.Handler, + isLeader *bool) (*MessageBusController, error) { ch := make(chan *nats.Msg, 8192) listeners := make(map[string]TopicListener) subscriptions := make([]*nats.Subscription, 0) @@ -67,7 +67,7 @@ func NewMessageBusController(conn *nats.Conn, agtMgr agent.Manager, subscriptions: subscriptions, } - err := mc.registerListeners(agtMgr, tpMgr, k8smetaHandler) + err := mc.registerListeners(agtMgr, tpMgr, fsMgr, k8smetaHandler) if err != nil { return nil, err } @@ -110,9 +110,9 @@ func (mc *MessageBusController) handleMessages() { } } -func (mc *MessageBusController) registerListeners(agtMgr agent.Manager, tpMgr *tracepoint.Manager, k8smetaHandler *k8smeta.Handler) error { +func (mc *MessageBusController) registerListeners(agtMgr agent.Manager, tpMgr *tracepoint.Manager, fsMgr *file_source.Manager, k8smetaHandler *k8smeta.Handler) error { // Register AgentTopicListener. - atl, err := NewAgentTopicListener(agtMgr, tpMgr, mc.sendMessage) + atl, err := NewAgentTopicListener(agtMgr, tpMgr, fsMgr, mc.sendMessage) if err != nil { return err } diff --git a/src/vizier/services/metadata/controllers/server.go b/src/vizier/services/metadata/controllers/server.go index 8c4a11eebe9..384ab215451 100644 --- a/src/vizier/services/metadata/controllers/server.go +++ b/src/vizier/services/metadata/controllers/server.go @@ -41,6 +41,7 @@ import ( "px.dev/pixie/src/table_store/schemapb" "px.dev/pixie/src/utils" "px.dev/pixie/src/vizier/services/metadata/controllers/agent" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" "px.dev/pixie/src/vizier/services/metadata/controllers/k8smeta" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" "px.dev/pixie/src/vizier/services/metadata/metadataenv" @@ -61,6 +62,7 @@ type Server struct { pls k8smeta.PodLabelStore agtMgr agent.Manager tpMgr *tracepoint.Manager + fsMgr *file_source.Manager // The current cursor that is actively running the GetAgentsUpdate stream. Only one GetAgentsUpdate // stream should be running at a time. getAgentsCursor uuid.UUID @@ -68,13 +70,14 @@ type Server struct { } // NewServer creates GRPC handlers. -func NewServer(env metadataenv.MetadataEnv, ds datastore.MultiGetterSetterDeleterCloser, pls k8smeta.PodLabelStore, agtMgr agent.Manager, tpMgr *tracepoint.Manager) *Server { +func NewServer(env metadataenv.MetadataEnv, ds datastore.MultiGetterSetterDeleterCloser, pls k8smeta.PodLabelStore, agtMgr agent.Manager, tpMgr *tracepoint.Manager, fsMgr *file_source.Manager) *Server { return &Server{ env: env, ds: ds, pls: pls, agtMgr: agtMgr, tpMgr: tpMgr, + fsMgr: fsMgr, } } @@ -98,6 +101,9 @@ func convertToRelationMap(computedSchema *storepb.ComputedSchema) (*schemapb.Sch Columns: columnPbs, Desc: schema.Desc, } + if schema.MutationId != "" { + schemaPb.MutationId = schema.MutationId + } respSchemaPb.RelationMap[schema.Name] = schemaPb } @@ -121,6 +127,9 @@ func convertToSchemaInfo(computedSchema *storepb.ComputedSchema) ([]*distributed schemaPb := &schemapb.Relation{ Columns: columnPbs, } + if schema.MutationId != "" { + schemaPb.MutationId = schema.MutationId + } agentIDs, ok := computedSchema.TableNameToAgentIDs[schema.Name] if !ok { @@ -565,6 +574,55 @@ func getTracepointStateFromAgentTracepointStates(agentStates []*storepb.AgentTra return statuspb.UNKNOWN_STATE, []*statuspb.Status{} } +func getFileSourceStateFromAgentFileSourceStates(agentStates []*storepb.AgentFileSourceStatus) (statuspb.LifeCycleState, []*statuspb.Status) { + if len(agentStates) == 0 { + return statuspb.PENDING_STATE, nil + } + + numFailed := 0 + numTerminated := 0 + numPending := 0 + numRunning := 0 + statuses := make([]*statuspb.Status, 0) + + for _, s := range agentStates { + switch s.State { + case statuspb.TERMINATED_STATE: + numTerminated++ + case statuspb.FAILED_STATE: + numFailed++ + if s.Status.ErrCode != statuspb.FAILED_PRECONDITION && s.Status.ErrCode != statuspb.OK { + statuses = append(statuses, s.Status) + } + case statuspb.PENDING_STATE: + numPending++ + case statuspb.RUNNING_STATE: + numRunning++ + } + } + + if numTerminated > 0 { // If any agentFileSources are terminated, then we consider the tracepoint in an terminated state. + return statuspb.TERMINATED_STATE, []*statuspb.Status{} + } + + if numRunning > 0 { // If a single agentFileSource is running, then we consider the overall tracepoint as healthy. + return statuspb.RUNNING_STATE, []*statuspb.Status{} + } + + if numPending > 0 { // If no agentFileSources are running, but some are in a pending state, the tracepoint is pending. + return statuspb.PENDING_STATE, []*statuspb.Status{} + } + + if numFailed > 0 { // If there are no terminated/running/pending tracepoints, then the tracepoint is failed. + if len(statuses) == 0 { + return statuspb.FAILED_STATE, []*statuspb.Status{agentStates[0].Status} // If there are no non FAILED_PRECONDITION statuses, just use the error from the first agent. + } + return statuspb.FAILED_STATE, statuses + } + + return statuspb.UNKNOWN_STATE, []*statuspb.Status{} +} + // RemoveTracepoint is a request to evict the given tracepoint on all agents. func (s *Server) RemoveTracepoint(ctx context.Context, req *metadatapb.RemoveTracepointRequest) (*metadatapb.RemoveTracepointResponse, error) { err := s.tpMgr.RemoveTracepoints(req.Names) @@ -579,6 +637,132 @@ func (s *Server) RemoveTracepoint(ctx context.Context, req *metadatapb.RemoveTra }, nil } +// RegisterFileSource is a request to register the file sources specified in the FileSourceDeployment on all agents. +func (s *Server) RegisterFileSource(ctx context.Context, req *metadatapb.RegisterFileSourceRequest) (*metadatapb.RegisterFileSourceResponse, error) { + responses := make([]*metadatapb.RegisterFileSourceResponse_FileSourceStatus, len(req.Requests)) + + // Create file source. + for i, fs := range req.Requests { + // TODO(ddelnano): Consider adding support for filtering by labels. + fileSourceID, err := s.fsMgr.CreateFileSource(fs.Name, fs) + if err != nil && err != file_source.ErrFileSourceAlreadyExists { + return nil, err + } + if err == file_source.ErrFileSourceAlreadyExists { + responses[i] = &metadatapb.RegisterFileSourceResponse_FileSourceStatus{ + ID: utils.ProtoFromUUID(*fileSourceID), + Status: &statuspb.Status{ + ErrCode: statuspb.ALREADY_EXISTS, + }, + Name: fs.Name, + } + continue + } + + responses[i] = &metadatapb.RegisterFileSourceResponse_FileSourceStatus{ + ID: utils.ProtoFromUUID(*fileSourceID), + Status: &statuspb.Status{ + ErrCode: statuspb.OK, + }, + Name: fs.Name, + } + + // Get all agents currently running. + agents, err := s.agtMgr.GetActiveAgents() + if err != nil { + return nil, err + } + + err = s.fsMgr.RegisterFileSource(agents, *fileSourceID, fs) + if err != nil { + return nil, err + } + } + + resp := &metadatapb.RegisterFileSourceResponse{ + FileSources: responses, + Status: &statuspb.Status{ + ErrCode: statuspb.OK, + }, + } + + return resp, nil +} + +// GetFileSourceInfo is a request to check the status for the given file source. +func (s *Server) GetFileSourceInfo(ctx context.Context, req *metadatapb.GetFileSourceInfoRequest) (*metadatapb.GetFileSourceInfoResponse, error) { + var fileSourceInfos []*storepb.FileSourceInfo + var err error + if len(req.IDs) > 0 { + ids := make([]uuid.UUID, len(req.IDs)) + for i, id := range req.IDs { + ids[i] = utils.UUIDFromProtoOrNil(id) + } + + fileSourceInfos, err = s.fsMgr.GetFileSourcesForIDs(ids) + } else { + fileSourceInfos, err = s.fsMgr.GetAllFileSources() + } + + if err != nil { + return nil, err + } + + fileSourceState := make([]*metadatapb.GetFileSourceInfoResponse_FileSourceState, len(fileSourceInfos)) + + for i, fs := range fileSourceInfos { + if fs == nil { // FileSourceDeployment does not exist. + fileSourceState[i] = &metadatapb.GetFileSourceInfoResponse_FileSourceState{ + ID: req.IDs[i], + State: statuspb.UNKNOWN_STATE, + Statuses: []*statuspb.Status{{ + ErrCode: statuspb.NOT_FOUND, + }}, + } + continue + } + tUUID := utils.UUIDFromProtoOrNil(fs.ID) + + fileSourceStates, err := s.fsMgr.GetFileSourceStates(tUUID) + if err != nil { + return nil, err + } + + state, statuses := getFileSourceStateFromAgentFileSourceStates(fileSourceStates) + + // TODO(ddelnano): For now file sources only have one schema + schemas := make([]string, 1) + schemas[0] = fs.FileSource.TableName + + fileSourceState[i] = &metadatapb.GetFileSourceInfoResponse_FileSourceState{ + ID: fs.ID, + State: state, + Statuses: statuses, + Name: fs.Name, + ExpectedState: fs.ExpectedState, + SchemaNames: schemas, + } + } + + return &metadatapb.GetFileSourceInfoResponse{ + FileSources: fileSourceState, + }, nil +} + +// RemoveFileSource is a request to evict the given file sources on all agents. +func (s *Server) RemoveFileSource(ctx context.Context, req *metadatapb.RemoveFileSourceRequest) (*metadatapb.RemoveFileSourceResponse, error) { + err := s.fsMgr.RemoveFileSources(req.Names) + if err != nil { + return nil, err + } + + return &metadatapb.RemoveFileSourceResponse{ + Status: &statuspb.Status{ + ErrCode: statuspb.OK, + }, + }, nil +} + // UpdateConfig updates the config for the specified agent. func (s *Server) UpdateConfig(ctx context.Context, req *metadatapb.UpdateConfigRequest) (*metadatapb.UpdateConfigResponse, error) { splitName := strings.Split(req.AgentPodName, "/") diff --git a/src/vizier/services/metadata/controllers/server_test.go b/src/vizier/services/metadata/controllers/server_test.go index 9a9dc844c9a..bfa36e4d2c9 100644 --- a/src/vizier/services/metadata/controllers/server_test.go +++ b/src/vizier/services/metadata/controllers/server_test.go @@ -55,6 +55,8 @@ import ( "px.dev/pixie/src/vizier/messages/messagespb" "px.dev/pixie/src/vizier/services/metadata/controllers" mock_agent "px.dev/pixie/src/vizier/services/metadata/controllers/agent/mock" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" + mock_file_source "px.dev/pixie/src/vizier/services/metadata/controllers/file_source/mock" "px.dev/pixie/src/vizier/services/metadata/controllers/testutils" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" mock_tracepoint "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint/mock" @@ -65,7 +67,7 @@ import ( ) func testTableInfos() []*storepb.TableInfo { - tableInfos := make([]*storepb.TableInfo, 2) + tableInfos := make([]*storepb.TableInfo, 3) schema1Cols := make([]*storepb.TableInfo_ColumnInfo, 3) schema1Cols[0] = &storepb.TableInfo_ColumnInfo{ @@ -100,6 +102,17 @@ func testTableInfos() []*storepb.TableInfo { Columns: schema2Cols, Desc: "table 2 desc", } + schema3Cols := make([]*storepb.TableInfo_ColumnInfo, 1) + schema3Cols[0] = &storepb.TableInfo_ColumnInfo{ + Name: "t3Col1", + DataType: 1, + } + tableInfos[2] = &storepb.TableInfo{ + Name: "table3", + Columns: schema3Cols, + Desc: "table 3 desc", + MutationId: "mutation id", + } return tableInfos } @@ -165,7 +178,7 @@ func TestGetAgentInfo(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil, nil) req := metadatapb.AgentInfoRequest{} @@ -211,7 +224,7 @@ func TestGetAgentInfoGetActiveAgentsFailed(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil, nil) req := metadatapb.AgentInfoRequest{} @@ -240,7 +253,7 @@ func TestGetSchemas(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, nil, nil) req := metadatapb.SchemaRequest{} @@ -249,7 +262,7 @@ func TestGetSchemas(t *testing.T) { require.NoError(t, err) assert.NotNil(t, resp) - assert.Equal(t, 2, len(resp.Schema.RelationMap)) + assert.Equal(t, 3, len(resp.Schema.RelationMap)) assert.Equal(t, "table 1 desc", resp.Schema.RelationMap["table1"].Desc) assert.Equal(t, 3, len(resp.Schema.RelationMap["table1"].Columns)) assert.Equal(t, "t1Col1", resp.Schema.RelationMap["table1"].Columns[0].ColumnName) @@ -348,7 +361,7 @@ func Test_Server_RegisterTracepoint(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr, nil) reqs := []*metadatapb.RegisterTracepointRequest_TracepointRequest{ { @@ -473,7 +486,7 @@ func Test_Server_RegisterTracepoint_Exists(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr, nil) reqs := []*metadatapb.RegisterTracepointRequest_TracepointRequest{ { @@ -613,8 +626,10 @@ func Test_Server_GetTracepointInfo(t *testing.T) { defer ctrl.Finish() mockAgtMgr := mock_agent.NewMockManager(ctrl) mockTracepointStore := mock_tracepoint.NewMockStore(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) tracepointMgr := tracepoint.NewManager(mockTracepointStore, mockAgtMgr, 5*time.Second) + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) program := &logicalpb.TracepointDeployment{ Programs: []*logicalpb.TracepointDeployment_TracepointProgram{ @@ -658,7 +673,7 @@ func Test_Server_GetTracepointInfo(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr, fileSourceMgr) req := metadatapb.GetTracepointInfoRequest{ IDs: []*uuidpb.UUID{utils.ProtoFromUUID(tID)}, } @@ -692,8 +707,10 @@ func Test_Server_RemoveTracepoint(t *testing.T) { defer ctrl.Finish() mockAgtMgr := mock_agent.NewMockManager(ctrl) mockTracepointStore := mock_tracepoint.NewMockStore(ctrl) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) tracepointMgr := tracepoint.NewManager(mockTracepointStore, mockAgtMgr, 5*time.Second) + fileSourceMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) tpID1 := uuid.Must(uuid.NewV4()) tpID2 := uuid.Must(uuid.NewV4()) @@ -716,7 +733,7 @@ func Test_Server_RemoveTracepoint(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr, fileSourceMgr) req := metadatapb.RemoveTracepointRequest{ Names: []string{"test1", "test2"}, @@ -831,6 +848,9 @@ func TestGetAgentUpdates(t *testing.T) { "table2": { AgentID: []*uuidpb.UUID{u1pb}, }, + "table3": { + AgentID: []*uuidpb.UUID{u1pb, u2pb}, + }, }, } @@ -902,7 +922,7 @@ func TestGetAgentUpdates(t *testing.T) { t.Fatal("Failed to create api environment.") } - srv := controllers.NewServer(mdEnv, nil, nil, mockAgtMgr, nil) + srv := controllers.NewServer(mdEnv, nil, nil, mockAgtMgr, nil, nil) env := env.New("withpixie.ai") s := server.CreateGRPCServer(env, &server.GRPCServerOptions{}) @@ -1012,7 +1032,7 @@ func TestGetAgentUpdates(t *testing.T) { assert.Equal(t, 1, len(r1.AgentUpdates)) assert.Equal(t, updates1[2], r1.AgentUpdates[0]) // Check schemas - assert.Equal(t, 2, len(r1.AgentSchemas)) + assert.Equal(t, 3, len(r1.AgentSchemas)) assert.Equal(t, "table1", r1.AgentSchemas[0].Name) assert.Equal(t, 3, len(r1.AgentSchemas[0].Relation.Columns)) assert.Equal(t, 2, len(r1.AgentSchemas[0].AgentList)) @@ -1022,6 +1042,12 @@ func TestGetAgentUpdates(t *testing.T) { assert.Equal(t, 2, len(r1.AgentSchemas[1].Relation.Columns)) assert.Equal(t, 1, len(r1.AgentSchemas[1].AgentList)) assert.Equal(t, u1pb, r1.AgentSchemas[1].AgentList[0]) + assert.Equal(t, "table3", r1.AgentSchemas[2].Name) + assert.Equal(t, 1, len(r1.AgentSchemas[2].Relation.Columns)) + assert.Equal(t, 2, len(r1.AgentSchemas[2].AgentList)) + assert.Equal(t, u1pb, r1.AgentSchemas[2].AgentList[0]) + assert.Equal(t, u2pb, r1.AgentSchemas[2].AgentList[1]) + assert.Equal(t, "mutation id", r1.AgentSchemas[2].Relation.MutationId) // Check empty message r2 := resps[2] @@ -1052,6 +1078,9 @@ func Test_Server_UpdateConfig(t *testing.T) { mockTracepointStore := mock_tracepoint.NewMockStore(ctrl) tracepointMgr := tracepoint.NewManager(mockTracepointStore, mockAgtMgr, 5*time.Second) + mockFileSourceStore := mock_file_source.NewMockStore(ctrl) + fsMgr := file_source.NewManager(mockFileSourceStore, mockAgtMgr, 5*time.Second) + mockAgtMgr. EXPECT(). UpdateConfig("pl", "pem-1234", "gprof", "true"). @@ -1063,7 +1092,7 @@ func Test_Server_UpdateConfig(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr) + s := controllers.NewServer(env, nil, nil, mockAgtMgr, tracepointMgr, fsMgr) req := metadatapb.UpdateConfigRequest{ AgentPodName: "pl/pem-1234", @@ -1104,7 +1133,7 @@ func Test_Server_ConvertLabelsToPods(t *testing.T) { t.Fatal("Failed to create api environment.") } - s := controllers.NewServer(env, nil, pls, nil, nil) + s := controllers.NewServer(env, nil, pls, nil, nil, nil) program := &logicalpb.TracepointDeployment{} err = proto.UnmarshalText(testutils.TDLabelSelectorPb, program) diff --git a/src/vizier/services/metadata/metadata_server.go b/src/vizier/services/metadata/metadata_server.go index b2959d80e98..75c5679d210 100644 --- a/src/vizier/services/metadata/metadata_server.go +++ b/src/vizier/services/metadata/metadata_server.go @@ -48,6 +48,7 @@ import ( "px.dev/pixie/src/vizier/services/metadata/controllers" "px.dev/pixie/src/vizier/services/metadata/controllers/agent" "px.dev/pixie/src/vizier/services/metadata/controllers/cronscript" + "px.dev/pixie/src/vizier/services/metadata/controllers/file_source" "px.dev/pixie/src/vizier/services/metadata/controllers/k8smeta" "px.dev/pixie/src/vizier/services/metadata/controllers/tracepoint" "px.dev/pixie/src/vizier/services/metadata/metadataenv" @@ -270,7 +271,12 @@ func main() { tracepointMgr := tracepoint.NewManager(tds, agtMgr, 30*time.Second) defer tracepointMgr.Close() - mc, err := controllers.NewMessageBusController(nc, agtMgr, tracepointMgr, + fds := file_source.NewDatastore(dataStore) + // Initialize file source handler. + fsMgr := file_source.NewManager(fds, agtMgr, 30*time.Second) + defer fsMgr.Close() + + mc, err := controllers.NewMessageBusController(nc, agtMgr, tracepointMgr, fsMgr, mdh, &isLeader) if err != nil { log.WithError(err).Fatal("Failed to connect to message bus") @@ -286,7 +292,7 @@ func main() { healthz.RegisterDefaultChecks(mux) metrics.MustRegisterMetricsHandlerNoDefaultMetrics(mux) - svr := controllers.NewServer(env, dataStore, k8sMds, agtMgr, tracepointMgr) + svr := controllers.NewServer(env, dataStore, k8sMds, agtMgr, tracepointMgr, fsMgr) csDs := cronscript.NewDatastore(dataStore) cronScriptSvr := cronscript.New(csDs) @@ -301,6 +307,7 @@ func main() { httpmiddleware.WithBearerAuthMiddleware(env, mux), maxMsgSize) metadatapb.RegisterMetadataServiceServer(s.GRPCServer(), svr) metadatapb.RegisterMetadataTracepointServiceServer(s.GRPCServer(), svr) + metadatapb.RegisterMetadataFileSourceServiceServer(s.GRPCServer(), svr) metadatapb.RegisterMetadataConfigServiceServer(s.GRPCServer(), svr) metadatapb.RegisterCronScriptStoreServiceServer(s.GRPCServer(), cronScriptSvr) diff --git a/src/vizier/services/metadata/metadatapb/BUILD.bazel b/src/vizier/services/metadata/metadatapb/BUILD.bazel index 11b8b4962db..c1b4c41ae1b 100644 --- a/src/vizier/services/metadata/metadatapb/BUILD.bazel +++ b/src/vizier/services/metadata/metadatapb/BUILD.bazel @@ -24,6 +24,7 @@ pl_proto_library( "//src/api/proto/uuidpb:uuid_pl_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_proto", + "//src/carnot/planner/file_source/ir:logical_pl_proto", "//src/common/base/statuspb:status_pl_proto", "//src/shared/cvmsgspb:cvmsgs_pl_proto", "//src/shared/types/typespb:types_pl_proto", @@ -42,6 +43,7 @@ pl_cc_proto_library( "//src/api/proto/uuidpb:uuid_pl_cc_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_cc_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_cc_proto", + "//src/carnot/planner/file_source/ir:logical_pl_cc_proto", "//src/common/base/statuspb:status_pl_cc_proto", "//src/shared/cvmsgspb:cvmsgs_pl_cc_proto", "//src/shared/types/typespb/wrapper:cc_library", @@ -61,6 +63,7 @@ pl_go_proto_library( "//src/api/proto/uuidpb:uuid_pl_go_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_go_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", "//src/common/base/statuspb:status_pl_go_proto", "//src/shared/cvmsgspb:cvmsgs_pl_go_proto", "//src/shared/types/typespb:types_pl_go_proto", diff --git a/src/vizier/services/metadata/metadatapb/service.pb.go b/src/vizier/services/metadata/metadatapb/service.pb.go index 64e34931455..52f764c4892 100755 --- a/src/vizier/services/metadata/metadatapb/service.pb.go +++ b/src/vizier/services/metadata/metadatapb/service.pb.go @@ -20,6 +20,7 @@ import ( uuidpb "px.dev/pixie/src/api/proto/uuidpb" distributedpb "px.dev/pixie/src/carnot/planner/distributedpb" logicalpb "px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb" + ir "px.dev/pixie/src/carnot/planner/file_source/ir" statuspb "px.dev/pixie/src/common/base/statuspb" cvmsgspb "px.dev/pixie/src/shared/cvmsgspb" schemapb "px.dev/pixie/src/table_store/schemapb" @@ -624,21 +625,21 @@ func (m *WithPrefixKeyResponse_KV) GetValue() []byte { return nil } -type RegisterTracepointRequest struct { - Requests []*RegisterTracepointRequest_TracepointRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +type RegisterFileSourceRequest struct { + Requests []*ir.FileSourceDeployment `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` } -func (m *RegisterTracepointRequest) Reset() { *m = RegisterTracepointRequest{} } -func (*RegisterTracepointRequest) ProtoMessage() {} -func (*RegisterTracepointRequest) Descriptor() ([]byte, []int) { +func (m *RegisterFileSourceRequest) Reset() { *m = RegisterFileSourceRequest{} } +func (*RegisterFileSourceRequest) ProtoMessage() {} +func (*RegisterFileSourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{10} } -func (m *RegisterTracepointRequest) XXX_Unmarshal(b []byte) error { +func (m *RegisterFileSourceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RegisterTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterFileSourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RegisterTracepointRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterFileSourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -648,102 +649,41 @@ func (m *RegisterTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *RegisterTracepointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterTracepointRequest.Merge(m, src) +func (m *RegisterFileSourceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterFileSourceRequest.Merge(m, src) } -func (m *RegisterTracepointRequest) XXX_Size() int { +func (m *RegisterFileSourceRequest) XXX_Size() int { return m.Size() } -func (m *RegisterTracepointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterTracepointRequest.DiscardUnknown(m) +func (m *RegisterFileSourceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterFileSourceRequest.DiscardUnknown(m) } -var xxx_messageInfo_RegisterTracepointRequest proto.InternalMessageInfo +var xxx_messageInfo_RegisterFileSourceRequest proto.InternalMessageInfo -func (m *RegisterTracepointRequest) GetRequests() []*RegisterTracepointRequest_TracepointRequest { +func (m *RegisterFileSourceRequest) GetRequests() []*ir.FileSourceDeployment { if m != nil { return m.Requests } return nil } -type RegisterTracepointRequest_TracepointRequest struct { - TracepointDeployment *logicalpb.TracepointDeployment `protobuf:"bytes,1,opt,name=tracepoint_deployment,json=tracepointDeployment,proto3" json:"tracepoint_deployment,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - TTL *types.Duration `protobuf:"bytes,3,opt,name=ttl,proto3" json:"ttl,omitempty"` -} - -func (m *RegisterTracepointRequest_TracepointRequest) Reset() { - *m = RegisterTracepointRequest_TracepointRequest{} -} -func (*RegisterTracepointRequest_TracepointRequest) ProtoMessage() {} -func (*RegisterTracepointRequest_TracepointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{10, 0} -} -func (m *RegisterTracepointRequest_TracepointRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RegisterTracepointRequest_TracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RegisterTracepointRequest_TracepointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.Merge(m, src) -} -func (m *RegisterTracepointRequest_TracepointRequest) XXX_Size() int { - return m.Size() -} -func (m *RegisterTracepointRequest_TracepointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterTracepointRequest_TracepointRequest proto.InternalMessageInfo - -func (m *RegisterTracepointRequest_TracepointRequest) GetTracepointDeployment() *logicalpb.TracepointDeployment { - if m != nil { - return m.TracepointDeployment - } - return nil -} - -func (m *RegisterTracepointRequest_TracepointRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *RegisterTracepointRequest_TracepointRequest) GetTTL() *types.Duration { - if m != nil { - return m.TTL - } - return nil -} - -type RegisterTracepointResponse struct { - Tracepoints []*RegisterTracepointResponse_TracepointStatus `protobuf:"bytes,1,rep,name=tracepoints,proto3" json:"tracepoints,omitempty"` +type RegisterFileSourceResponse struct { + FileSources []*RegisterFileSourceResponse_FileSourceStatus `protobuf:"bytes,1,rep,name=file_sources,json=fileSources,proto3" json:"file_sources,omitempty"` Status *statuspb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` } -func (m *RegisterTracepointResponse) Reset() { *m = RegisterTracepointResponse{} } -func (*RegisterTracepointResponse) ProtoMessage() {} -func (*RegisterTracepointResponse) Descriptor() ([]byte, []int) { +func (m *RegisterFileSourceResponse) Reset() { *m = RegisterFileSourceResponse{} } +func (*RegisterFileSourceResponse) ProtoMessage() {} +func (*RegisterFileSourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{11} } -func (m *RegisterTracepointResponse) XXX_Unmarshal(b []byte) error { +func (m *RegisterFileSourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RegisterTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterFileSourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RegisterTracepointResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterFileSourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -753,51 +693,51 @@ func (m *RegisterTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *RegisterTracepointResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterTracepointResponse.Merge(m, src) +func (m *RegisterFileSourceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterFileSourceResponse.Merge(m, src) } -func (m *RegisterTracepointResponse) XXX_Size() int { +func (m *RegisterFileSourceResponse) XXX_Size() int { return m.Size() } -func (m *RegisterTracepointResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterTracepointResponse.DiscardUnknown(m) +func (m *RegisterFileSourceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterFileSourceResponse.DiscardUnknown(m) } -var xxx_messageInfo_RegisterTracepointResponse proto.InternalMessageInfo +var xxx_messageInfo_RegisterFileSourceResponse proto.InternalMessageInfo -func (m *RegisterTracepointResponse) GetTracepoints() []*RegisterTracepointResponse_TracepointStatus { +func (m *RegisterFileSourceResponse) GetFileSources() []*RegisterFileSourceResponse_FileSourceStatus { if m != nil { - return m.Tracepoints + return m.FileSources } return nil } -func (m *RegisterTracepointResponse) GetStatus() *statuspb.Status { +func (m *RegisterFileSourceResponse) GetStatus() *statuspb.Status { if m != nil { return m.Status } return nil } -type RegisterTracepointResponse_TracepointStatus struct { +type RegisterFileSourceResponse_FileSourceStatus struct { Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` ID *uuidpb.UUID `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` } -func (m *RegisterTracepointResponse_TracepointStatus) Reset() { - *m = RegisterTracepointResponse_TracepointStatus{} +func (m *RegisterFileSourceResponse_FileSourceStatus) Reset() { + *m = RegisterFileSourceResponse_FileSourceStatus{} } -func (*RegisterTracepointResponse_TracepointStatus) ProtoMessage() {} -func (*RegisterTracepointResponse_TracepointStatus) Descriptor() ([]byte, []int) { +func (*RegisterFileSourceResponse_FileSourceStatus) ProtoMessage() {} +func (*RegisterFileSourceResponse_FileSourceStatus) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{11, 0} } -func (m *RegisterTracepointResponse_TracepointStatus) XXX_Unmarshal(b []byte) error { +func (m *RegisterFileSourceResponse_FileSourceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RegisterTracepointResponse_TracepointStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterFileSourceResponse_FileSourceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterFileSourceResponse_FileSourceStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -807,54 +747,54 @@ func (m *RegisterTracepointResponse_TracepointStatus) XXX_Marshal(b []byte, dete return b[:n], nil } } -func (m *RegisterTracepointResponse_TracepointStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.Merge(m, src) +func (m *RegisterFileSourceResponse_FileSourceStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterFileSourceResponse_FileSourceStatus.Merge(m, src) } -func (m *RegisterTracepointResponse_TracepointStatus) XXX_Size() int { +func (m *RegisterFileSourceResponse_FileSourceStatus) XXX_Size() int { return m.Size() } -func (m *RegisterTracepointResponse_TracepointStatus) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.DiscardUnknown(m) +func (m *RegisterFileSourceResponse_FileSourceStatus) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterFileSourceResponse_FileSourceStatus.DiscardUnknown(m) } -var xxx_messageInfo_RegisterTracepointResponse_TracepointStatus proto.InternalMessageInfo +var xxx_messageInfo_RegisterFileSourceResponse_FileSourceStatus proto.InternalMessageInfo -func (m *RegisterTracepointResponse_TracepointStatus) GetStatus() *statuspb.Status { +func (m *RegisterFileSourceResponse_FileSourceStatus) GetStatus() *statuspb.Status { if m != nil { return m.Status } return nil } -func (m *RegisterTracepointResponse_TracepointStatus) GetID() *uuidpb.UUID { +func (m *RegisterFileSourceResponse_FileSourceStatus) GetID() *uuidpb.UUID { if m != nil { return m.ID } return nil } -func (m *RegisterTracepointResponse_TracepointStatus) GetName() string { +func (m *RegisterFileSourceResponse_FileSourceStatus) GetName() string { if m != nil { return m.Name } return "" } -type GetTracepointInfoRequest struct { +type GetFileSourceInfoRequest struct { IDs []*uuidpb.UUID `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` } -func (m *GetTracepointInfoRequest) Reset() { *m = GetTracepointInfoRequest{} } -func (*GetTracepointInfoRequest) ProtoMessage() {} -func (*GetTracepointInfoRequest) Descriptor() ([]byte, []int) { +func (m *GetFileSourceInfoRequest) Reset() { *m = GetFileSourceInfoRequest{} } +func (*GetFileSourceInfoRequest) ProtoMessage() {} +func (*GetFileSourceInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{12} } -func (m *GetTracepointInfoRequest) XXX_Unmarshal(b []byte) error { +func (m *GetFileSourceInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetTracepointInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetFileSourceInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetTracepointInfoRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_GetFileSourceInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -864,40 +804,40 @@ func (m *GetTracepointInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *GetTracepointInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTracepointInfoRequest.Merge(m, src) +func (m *GetFileSourceInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFileSourceInfoRequest.Merge(m, src) } -func (m *GetTracepointInfoRequest) XXX_Size() int { +func (m *GetFileSourceInfoRequest) XXX_Size() int { return m.Size() } -func (m *GetTracepointInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTracepointInfoRequest.DiscardUnknown(m) +func (m *GetFileSourceInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetFileSourceInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_GetTracepointInfoRequest proto.InternalMessageInfo +var xxx_messageInfo_GetFileSourceInfoRequest proto.InternalMessageInfo -func (m *GetTracepointInfoRequest) GetIDs() []*uuidpb.UUID { +func (m *GetFileSourceInfoRequest) GetIDs() []*uuidpb.UUID { if m != nil { return m.IDs } return nil } -type GetTracepointInfoResponse struct { - Tracepoints []*GetTracepointInfoResponse_TracepointState `protobuf:"bytes,1,rep,name=tracepoints,proto3" json:"tracepoints,omitempty"` +type GetFileSourceInfoResponse struct { + FileSources []*GetFileSourceInfoResponse_FileSourceState `protobuf:"bytes,1,rep,name=file_sources,json=fileSources,proto3" json:"file_sources,omitempty"` } -func (m *GetTracepointInfoResponse) Reset() { *m = GetTracepointInfoResponse{} } -func (*GetTracepointInfoResponse) ProtoMessage() {} -func (*GetTracepointInfoResponse) Descriptor() ([]byte, []int) { +func (m *GetFileSourceInfoResponse) Reset() { *m = GetFileSourceInfoResponse{} } +func (*GetFileSourceInfoResponse) ProtoMessage() {} +func (*GetFileSourceInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{13} } -func (m *GetTracepointInfoResponse) XXX_Unmarshal(b []byte) error { +func (m *GetFileSourceInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetTracepointInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetFileSourceInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetTracepointInfoResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_GetFileSourceInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -907,26 +847,26 @@ func (m *GetTracepointInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *GetTracepointInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTracepointInfoResponse.Merge(m, src) +func (m *GetFileSourceInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFileSourceInfoResponse.Merge(m, src) } -func (m *GetTracepointInfoResponse) XXX_Size() int { +func (m *GetFileSourceInfoResponse) XXX_Size() int { return m.Size() } -func (m *GetTracepointInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTracepointInfoResponse.DiscardUnknown(m) +func (m *GetFileSourceInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetFileSourceInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetTracepointInfoResponse proto.InternalMessageInfo +var xxx_messageInfo_GetFileSourceInfoResponse proto.InternalMessageInfo -func (m *GetTracepointInfoResponse) GetTracepoints() []*GetTracepointInfoResponse_TracepointState { +func (m *GetFileSourceInfoResponse) GetFileSources() []*GetFileSourceInfoResponse_FileSourceState { if m != nil { - return m.Tracepoints + return m.FileSources } return nil } -type GetTracepointInfoResponse_TracepointState struct { +type GetFileSourceInfoResponse_FileSourceState struct { ID *uuidpb.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` State statuspb.LifeCycleState `protobuf:"varint,2,opt,name=state,proto3,enum=px.statuspb.LifeCycleState" json:"state,omitempty"` Statuses []*statuspb.Status `protobuf:"bytes,3,rep,name=statuses,proto3" json:"statuses,omitempty"` @@ -935,19 +875,19 @@ type GetTracepointInfoResponse_TracepointState struct { SchemaNames []string `protobuf:"bytes,6,rep,name=schema_names,json=schemaNames,proto3" json:"schema_names,omitempty"` } -func (m *GetTracepointInfoResponse_TracepointState) Reset() { - *m = GetTracepointInfoResponse_TracepointState{} +func (m *GetFileSourceInfoResponse_FileSourceState) Reset() { + *m = GetFileSourceInfoResponse_FileSourceState{} } -func (*GetTracepointInfoResponse_TracepointState) ProtoMessage() {} -func (*GetTracepointInfoResponse_TracepointState) Descriptor() ([]byte, []int) { +func (*GetFileSourceInfoResponse_FileSourceState) ProtoMessage() {} +func (*GetFileSourceInfoResponse_FileSourceState) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{13, 0} } -func (m *GetTracepointInfoResponse_TracepointState) XXX_Unmarshal(b []byte) error { +func (m *GetFileSourceInfoResponse_FileSourceState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetTracepointInfoResponse_TracepointState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetFileSourceInfoResponse_FileSourceState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetTracepointInfoResponse_TracepointState.Marshal(b, m, deterministic) + return xxx_messageInfo_GetFileSourceInfoResponse_FileSourceState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -957,75 +897,75 @@ func (m *GetTracepointInfoResponse_TracepointState) XXX_Marshal(b []byte, determ return b[:n], nil } } -func (m *GetTracepointInfoResponse_TracepointState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTracepointInfoResponse_TracepointState.Merge(m, src) +func (m *GetFileSourceInfoResponse_FileSourceState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFileSourceInfoResponse_FileSourceState.Merge(m, src) } -func (m *GetTracepointInfoResponse_TracepointState) XXX_Size() int { +func (m *GetFileSourceInfoResponse_FileSourceState) XXX_Size() int { return m.Size() } -func (m *GetTracepointInfoResponse_TracepointState) XXX_DiscardUnknown() { - xxx_messageInfo_GetTracepointInfoResponse_TracepointState.DiscardUnknown(m) +func (m *GetFileSourceInfoResponse_FileSourceState) XXX_DiscardUnknown() { + xxx_messageInfo_GetFileSourceInfoResponse_FileSourceState.DiscardUnknown(m) } -var xxx_messageInfo_GetTracepointInfoResponse_TracepointState proto.InternalMessageInfo +var xxx_messageInfo_GetFileSourceInfoResponse_FileSourceState proto.InternalMessageInfo -func (m *GetTracepointInfoResponse_TracepointState) GetID() *uuidpb.UUID { +func (m *GetFileSourceInfoResponse_FileSourceState) GetID() *uuidpb.UUID { if m != nil { return m.ID } return nil } -func (m *GetTracepointInfoResponse_TracepointState) GetState() statuspb.LifeCycleState { +func (m *GetFileSourceInfoResponse_FileSourceState) GetState() statuspb.LifeCycleState { if m != nil { return m.State } return statuspb.UNKNOWN_STATE } -func (m *GetTracepointInfoResponse_TracepointState) GetStatuses() []*statuspb.Status { +func (m *GetFileSourceInfoResponse_FileSourceState) GetStatuses() []*statuspb.Status { if m != nil { return m.Statuses } return nil } -func (m *GetTracepointInfoResponse_TracepointState) GetName() string { +func (m *GetFileSourceInfoResponse_FileSourceState) GetName() string { if m != nil { return m.Name } return "" } -func (m *GetTracepointInfoResponse_TracepointState) GetExpectedState() statuspb.LifeCycleState { +func (m *GetFileSourceInfoResponse_FileSourceState) GetExpectedState() statuspb.LifeCycleState { if m != nil { return m.ExpectedState } return statuspb.UNKNOWN_STATE } -func (m *GetTracepointInfoResponse_TracepointState) GetSchemaNames() []string { +func (m *GetFileSourceInfoResponse_FileSourceState) GetSchemaNames() []string { if m != nil { return m.SchemaNames } return nil } -type RemoveTracepointRequest struct { +type RemoveFileSourceRequest struct { Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` } -func (m *RemoveTracepointRequest) Reset() { *m = RemoveTracepointRequest{} } -func (*RemoveTracepointRequest) ProtoMessage() {} -func (*RemoveTracepointRequest) Descriptor() ([]byte, []int) { +func (m *RemoveFileSourceRequest) Reset() { *m = RemoveFileSourceRequest{} } +func (*RemoveFileSourceRequest) ProtoMessage() {} +func (*RemoveFileSourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{14} } -func (m *RemoveTracepointRequest) XXX_Unmarshal(b []byte) error { +func (m *RemoveFileSourceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RemoveTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RemoveFileSourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RemoveTracepointRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RemoveFileSourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1035,40 +975,40 @@ func (m *RemoveTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *RemoveTracepointRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveTracepointRequest.Merge(m, src) +func (m *RemoveFileSourceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveFileSourceRequest.Merge(m, src) } -func (m *RemoveTracepointRequest) XXX_Size() int { +func (m *RemoveFileSourceRequest) XXX_Size() int { return m.Size() } -func (m *RemoveTracepointRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveTracepointRequest.DiscardUnknown(m) +func (m *RemoveFileSourceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveFileSourceRequest.DiscardUnknown(m) } -var xxx_messageInfo_RemoveTracepointRequest proto.InternalMessageInfo +var xxx_messageInfo_RemoveFileSourceRequest proto.InternalMessageInfo -func (m *RemoveTracepointRequest) GetNames() []string { +func (m *RemoveFileSourceRequest) GetNames() []string { if m != nil { return m.Names } return nil } -type RemoveTracepointResponse struct { +type RemoveFileSourceResponse struct { Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` } -func (m *RemoveTracepointResponse) Reset() { *m = RemoveTracepointResponse{} } -func (*RemoveTracepointResponse) ProtoMessage() {} -func (*RemoveTracepointResponse) Descriptor() ([]byte, []int) { +func (m *RemoveFileSourceResponse) Reset() { *m = RemoveFileSourceResponse{} } +func (*RemoveFileSourceResponse) ProtoMessage() {} +func (*RemoveFileSourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{15} } -func (m *RemoveTracepointResponse) XXX_Unmarshal(b []byte) error { +func (m *RemoveFileSourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RemoveTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RemoveFileSourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RemoveTracepointResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RemoveFileSourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1078,42 +1018,40 @@ func (m *RemoveTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *RemoveTracepointResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveTracepointResponse.Merge(m, src) +func (m *RemoveFileSourceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveFileSourceResponse.Merge(m, src) } -func (m *RemoveTracepointResponse) XXX_Size() int { +func (m *RemoveFileSourceResponse) XXX_Size() int { return m.Size() } -func (m *RemoveTracepointResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveTracepointResponse.DiscardUnknown(m) +func (m *RemoveFileSourceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveFileSourceResponse.DiscardUnknown(m) } -var xxx_messageInfo_RemoveTracepointResponse proto.InternalMessageInfo +var xxx_messageInfo_RemoveFileSourceResponse proto.InternalMessageInfo -func (m *RemoveTracepointResponse) GetStatus() *statuspb.Status { +func (m *RemoveFileSourceResponse) GetStatus() *statuspb.Status { if m != nil { return m.Status } return nil } -type UpdateConfigRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - AgentPodName string `protobuf:"bytes,3,opt,name=agent_pod_name,json=agentPodName,proto3" json:"agent_pod_name,omitempty"` +type RegisterTracepointRequest struct { + Requests []*RegisterTracepointRequest_TracepointRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` } -func (m *UpdateConfigRequest) Reset() { *m = UpdateConfigRequest{} } -func (*UpdateConfigRequest) ProtoMessage() {} -func (*UpdateConfigRequest) Descriptor() ([]byte, []int) { +func (m *RegisterTracepointRequest) Reset() { *m = RegisterTracepointRequest{} } +func (*RegisterTracepointRequest) ProtoMessage() {} +func (*RegisterTracepointRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bfe4468195647430, []int{16} } -func (m *UpdateConfigRequest) XXX_Unmarshal(b []byte) error { +func (m *RegisterTracepointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UpdateConfigRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterTracepointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1123,54 +1061,44 @@ func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *UpdateConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateConfigRequest.Merge(m, src) +func (m *RegisterTracepointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterTracepointRequest.Merge(m, src) } -func (m *UpdateConfigRequest) XXX_Size() int { +func (m *RegisterTracepointRequest) XXX_Size() int { return m.Size() } -func (m *UpdateConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateConfigRequest.DiscardUnknown(m) +func (m *RegisterTracepointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterTracepointRequest.DiscardUnknown(m) } -var xxx_messageInfo_UpdateConfigRequest proto.InternalMessageInfo - -func (m *UpdateConfigRequest) GetKey() string { - if m != nil { - return m.Key - } - return "" -} +var xxx_messageInfo_RegisterTracepointRequest proto.InternalMessageInfo -func (m *UpdateConfigRequest) GetValue() string { +func (m *RegisterTracepointRequest) GetRequests() []*RegisterTracepointRequest_TracepointRequest { if m != nil { - return m.Value + return m.Requests } - return "" + return nil } -func (m *UpdateConfigRequest) GetAgentPodName() string { - if m != nil { - return m.AgentPodName - } - return "" +type RegisterTracepointRequest_TracepointRequest struct { + TracepointDeployment *logicalpb.TracepointDeployment `protobuf:"bytes,1,opt,name=tracepoint_deployment,json=tracepointDeployment,proto3" json:"tracepoint_deployment,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + TTL *types.Duration `protobuf:"bytes,3,opt,name=ttl,proto3" json:"ttl,omitempty"` } -type UpdateConfigResponse struct { - Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +func (m *RegisterTracepointRequest_TracepointRequest) Reset() { + *m = RegisterTracepointRequest_TracepointRequest{} } - -func (m *UpdateConfigResponse) Reset() { *m = UpdateConfigResponse{} } -func (*UpdateConfigResponse) ProtoMessage() {} -func (*UpdateConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{17} +func (*RegisterTracepointRequest_TracepointRequest) ProtoMessage() {} +func (*RegisterTracepointRequest_TracepointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{16, 0} } -func (m *UpdateConfigResponse) XXX_Unmarshal(b []byte) error { +func (m *RegisterTracepointRequest_TracepointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterTracepointRequest_TracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_UpdateConfigResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1180,75 +1108,55 @@ func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *UpdateConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateConfigResponse.Merge(m, src) +func (m *RegisterTracepointRequest_TracepointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.Merge(m, src) } -func (m *UpdateConfigResponse) XXX_Size() int { +func (m *RegisterTracepointRequest_TracepointRequest) XXX_Size() int { return m.Size() } -func (m *UpdateConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateConfigResponse.DiscardUnknown(m) +func (m *RegisterTracepointRequest_TracepointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterTracepointRequest_TracepointRequest.DiscardUnknown(m) } -var xxx_messageInfo_UpdateConfigResponse proto.InternalMessageInfo +var xxx_messageInfo_RegisterTracepointRequest_TracepointRequest proto.InternalMessageInfo -func (m *UpdateConfigResponse) GetStatus() *statuspb.Status { +func (m *RegisterTracepointRequest_TracepointRequest) GetTracepointDeployment() *logicalpb.TracepointDeployment { if m != nil { - return m.Status + return m.TracepointDeployment } return nil } -type GetScriptsRequest struct { +func (m *RegisterTracepointRequest_TracepointRequest) GetName() string { + if m != nil { + return m.Name + } + return "" } -func (m *GetScriptsRequest) Reset() { *m = GetScriptsRequest{} } -func (*GetScriptsRequest) ProtoMessage() {} -func (*GetScriptsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{18} -} -func (m *GetScriptsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetScriptsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *RegisterTracepointRequest_TracepointRequest) GetTTL() *types.Duration { + if m != nil { + return m.TTL } + return nil } -func (m *GetScriptsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetScriptsRequest.Merge(m, src) -} -func (m *GetScriptsRequest) XXX_Size() int { - return m.Size() -} -func (m *GetScriptsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetScriptsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetScriptsRequest proto.InternalMessageInfo -type GetScriptsResponse struct { - Scripts map[string]*cvmsgspb.CronScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +type RegisterTracepointResponse struct { + Tracepoints []*RegisterTracepointResponse_TracepointStatus `protobuf:"bytes,1,rep,name=tracepoints,proto3" json:"tracepoints,omitempty"` + Status *statuspb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` } -func (m *GetScriptsResponse) Reset() { *m = GetScriptsResponse{} } -func (*GetScriptsResponse) ProtoMessage() {} -func (*GetScriptsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{19} +func (m *RegisterTracepointResponse) Reset() { *m = RegisterTracepointResponse{} } +func (*RegisterTracepointResponse) ProtoMessage() {} +func (*RegisterTracepointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{17} } -func (m *GetScriptsResponse) XXX_Unmarshal(b []byte) error { +func (m *RegisterTracepointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetScriptsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterTracepointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1258,40 +1166,51 @@ func (m *GetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *GetScriptsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetScriptsResponse.Merge(m, src) +func (m *RegisterTracepointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterTracepointResponse.Merge(m, src) } -func (m *GetScriptsResponse) XXX_Size() int { +func (m *RegisterTracepointResponse) XXX_Size() int { return m.Size() } -func (m *GetScriptsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetScriptsResponse.DiscardUnknown(m) +func (m *RegisterTracepointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterTracepointResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetScriptsResponse proto.InternalMessageInfo +var xxx_messageInfo_RegisterTracepointResponse proto.InternalMessageInfo -func (m *GetScriptsResponse) GetScripts() map[string]*cvmsgspb.CronScript { +func (m *RegisterTracepointResponse) GetTracepoints() []*RegisterTracepointResponse_TracepointStatus { if m != nil { - return m.Scripts + return m.Tracepoints } return nil } -type AddOrUpdateScriptRequest struct { - Script *cvmsgspb.CronScript `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` +func (m *RegisterTracepointResponse) GetStatus() *statuspb.Status { + if m != nil { + return m.Status + } + return nil } -func (m *AddOrUpdateScriptRequest) Reset() { *m = AddOrUpdateScriptRequest{} } -func (*AddOrUpdateScriptRequest) ProtoMessage() {} -func (*AddOrUpdateScriptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{20} +type RegisterTracepointResponse_TracepointStatus struct { + Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + ID *uuidpb.UUID `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` } -func (m *AddOrUpdateScriptRequest) XXX_Unmarshal(b []byte) error { + +func (m *RegisterTracepointResponse_TracepointStatus) Reset() { + *m = RegisterTracepointResponse_TracepointStatus{} +} +func (*RegisterTracepointResponse_TracepointStatus) ProtoMessage() {} +func (*RegisterTracepointResponse_TracepointStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{17, 0} +} +func (m *RegisterTracepointResponse_TracepointStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AddOrUpdateScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RegisterTracepointResponse_TracepointStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AddOrUpdateScriptRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1301,39 +1220,54 @@ func (m *AddOrUpdateScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *AddOrUpdateScriptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddOrUpdateScriptRequest.Merge(m, src) +func (m *RegisterTracepointResponse_TracepointStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.Merge(m, src) } -func (m *AddOrUpdateScriptRequest) XXX_Size() int { +func (m *RegisterTracepointResponse_TracepointStatus) XXX_Size() int { return m.Size() } -func (m *AddOrUpdateScriptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddOrUpdateScriptRequest.DiscardUnknown(m) +func (m *RegisterTracepointResponse_TracepointStatus) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterTracepointResponse_TracepointStatus.DiscardUnknown(m) } -var xxx_messageInfo_AddOrUpdateScriptRequest proto.InternalMessageInfo +var xxx_messageInfo_RegisterTracepointResponse_TracepointStatus proto.InternalMessageInfo -func (m *AddOrUpdateScriptRequest) GetScript() *cvmsgspb.CronScript { +func (m *RegisterTracepointResponse_TracepointStatus) GetStatus() *statuspb.Status { if m != nil { - return m.Script + return m.Status } return nil } -type AddOrUpdateScriptResponse struct { +func (m *RegisterTracepointResponse_TracepointStatus) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil } -func (m *AddOrUpdateScriptResponse) Reset() { *m = AddOrUpdateScriptResponse{} } -func (*AddOrUpdateScriptResponse) ProtoMessage() {} -func (*AddOrUpdateScriptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{21} +func (m *RegisterTracepointResponse_TracepointStatus) GetName() string { + if m != nil { + return m.Name + } + return "" } -func (m *AddOrUpdateScriptResponse) XXX_Unmarshal(b []byte) error { + +type GetTracepointInfoRequest struct { + IDs []*uuidpb.UUID `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` +} + +func (m *GetTracepointInfoRequest) Reset() { *m = GetTracepointInfoRequest{} } +func (*GetTracepointInfoRequest) ProtoMessage() {} +func (*GetTracepointInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{18} +} +func (m *GetTracepointInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AddOrUpdateScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetTracepointInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AddOrUpdateScriptResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_GetTracepointInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1343,33 +1277,40 @@ func (m *AddOrUpdateScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *AddOrUpdateScriptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddOrUpdateScriptResponse.Merge(m, src) +func (m *GetTracepointInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTracepointInfoRequest.Merge(m, src) } -func (m *AddOrUpdateScriptResponse) XXX_Size() int { +func (m *GetTracepointInfoRequest) XXX_Size() int { return m.Size() } -func (m *AddOrUpdateScriptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddOrUpdateScriptResponse.DiscardUnknown(m) +func (m *GetTracepointInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetTracepointInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_AddOrUpdateScriptResponse proto.InternalMessageInfo +var xxx_messageInfo_GetTracepointInfoRequest proto.InternalMessageInfo -type DeleteScriptRequest struct { - ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` +func (m *GetTracepointInfoRequest) GetIDs() []*uuidpb.UUID { + if m != nil { + return m.IDs + } + return nil } -func (m *DeleteScriptRequest) Reset() { *m = DeleteScriptRequest{} } -func (*DeleteScriptRequest) ProtoMessage() {} -func (*DeleteScriptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{22} +type GetTracepointInfoResponse struct { + Tracepoints []*GetTracepointInfoResponse_TracepointState `protobuf:"bytes,1,rep,name=tracepoints,proto3" json:"tracepoints,omitempty"` } -func (m *DeleteScriptRequest) XXX_Unmarshal(b []byte) error { + +func (m *GetTracepointInfoResponse) Reset() { *m = GetTracepointInfoResponse{} } +func (*GetTracepointInfoResponse) ProtoMessage() {} +func (*GetTracepointInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{19} +} +func (m *GetTracepointInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DeleteScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetTracepointInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DeleteScriptRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_GetTracepointInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1379,39 +1320,47 @@ func (m *DeleteScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *DeleteScriptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteScriptRequest.Merge(m, src) +func (m *GetTracepointInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTracepointInfoResponse.Merge(m, src) } -func (m *DeleteScriptRequest) XXX_Size() int { +func (m *GetTracepointInfoResponse) XXX_Size() int { return m.Size() } -func (m *DeleteScriptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteScriptRequest.DiscardUnknown(m) +func (m *GetTracepointInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetTracepointInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_DeleteScriptRequest proto.InternalMessageInfo +var xxx_messageInfo_GetTracepointInfoResponse proto.InternalMessageInfo -func (m *DeleteScriptRequest) GetScriptID() *uuidpb.UUID { +func (m *GetTracepointInfoResponse) GetTracepoints() []*GetTracepointInfoResponse_TracepointState { if m != nil { - return m.ScriptID + return m.Tracepoints } return nil } -type DeleteScriptResponse struct { +type GetTracepointInfoResponse_TracepointState struct { + ID *uuidpb.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + State statuspb.LifeCycleState `protobuf:"varint,2,opt,name=state,proto3,enum=px.statuspb.LifeCycleState" json:"state,omitempty"` + Statuses []*statuspb.Status `protobuf:"bytes,3,rep,name=statuses,proto3" json:"statuses,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + ExpectedState statuspb.LifeCycleState `protobuf:"varint,5,opt,name=expected_state,json=expectedState,proto3,enum=px.statuspb.LifeCycleState" json:"expected_state,omitempty"` + SchemaNames []string `protobuf:"bytes,6,rep,name=schema_names,json=schemaNames,proto3" json:"schema_names,omitempty"` } -func (m *DeleteScriptResponse) Reset() { *m = DeleteScriptResponse{} } -func (*DeleteScriptResponse) ProtoMessage() {} -func (*DeleteScriptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{23} +func (m *GetTracepointInfoResponse_TracepointState) Reset() { + *m = GetTracepointInfoResponse_TracepointState{} } -func (m *DeleteScriptResponse) XXX_Unmarshal(b []byte) error { +func (*GetTracepointInfoResponse_TracepointState) ProtoMessage() {} +func (*GetTracepointInfoResponse_TracepointState) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{19, 0} +} +func (m *GetTracepointInfoResponse_TracepointState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DeleteScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetTracepointInfoResponse_TracepointState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DeleteScriptResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_GetTracepointInfoResponse_TracepointState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1421,33 +1370,75 @@ func (m *DeleteScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *DeleteScriptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteScriptResponse.Merge(m, src) +func (m *GetTracepointInfoResponse_TracepointState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTracepointInfoResponse_TracepointState.Merge(m, src) } -func (m *DeleteScriptResponse) XXX_Size() int { +func (m *GetTracepointInfoResponse_TracepointState) XXX_Size() int { return m.Size() } -func (m *DeleteScriptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteScriptResponse.DiscardUnknown(m) +func (m *GetTracepointInfoResponse_TracepointState) XXX_DiscardUnknown() { + xxx_messageInfo_GetTracepointInfoResponse_TracepointState.DiscardUnknown(m) } -var xxx_messageInfo_DeleteScriptResponse proto.InternalMessageInfo +var xxx_messageInfo_GetTracepointInfoResponse_TracepointState proto.InternalMessageInfo -type SetScriptsRequest struct { - Scripts map[string]*cvmsgspb.CronScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} +func (m *GetTracepointInfoResponse_TracepointState) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} -func (m *SetScriptsRequest) Reset() { *m = SetScriptsRequest{} } -func (*SetScriptsRequest) ProtoMessage() {} -func (*SetScriptsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{24} +func (m *GetTracepointInfoResponse_TracepointState) GetState() statuspb.LifeCycleState { + if m != nil { + return m.State + } + return statuspb.UNKNOWN_STATE } -func (m *SetScriptsRequest) XXX_Unmarshal(b []byte) error { + +func (m *GetTracepointInfoResponse_TracepointState) GetStatuses() []*statuspb.Status { + if m != nil { + return m.Statuses + } + return nil +} + +func (m *GetTracepointInfoResponse_TracepointState) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GetTracepointInfoResponse_TracepointState) GetExpectedState() statuspb.LifeCycleState { + if m != nil { + return m.ExpectedState + } + return statuspb.UNKNOWN_STATE +} + +func (m *GetTracepointInfoResponse_TracepointState) GetSchemaNames() []string { + if m != nil { + return m.SchemaNames + } + return nil +} + +type RemoveTracepointRequest struct { + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` +} + +func (m *RemoveTracepointRequest) Reset() { *m = RemoveTracepointRequest{} } +func (*RemoveTracepointRequest) ProtoMessage() {} +func (*RemoveTracepointRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{20} +} +func (m *RemoveTracepointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SetScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RemoveTracepointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SetScriptsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_RemoveTracepointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1457,39 +1448,40 @@ func (m *SetScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *SetScriptsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetScriptsRequest.Merge(m, src) +func (m *RemoveTracepointRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveTracepointRequest.Merge(m, src) } -func (m *SetScriptsRequest) XXX_Size() int { +func (m *RemoveTracepointRequest) XXX_Size() int { return m.Size() } -func (m *SetScriptsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SetScriptsRequest.DiscardUnknown(m) +func (m *RemoveTracepointRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveTracepointRequest.DiscardUnknown(m) } -var xxx_messageInfo_SetScriptsRequest proto.InternalMessageInfo +var xxx_messageInfo_RemoveTracepointRequest proto.InternalMessageInfo -func (m *SetScriptsRequest) GetScripts() map[string]*cvmsgspb.CronScript { +func (m *RemoveTracepointRequest) GetNames() []string { if m != nil { - return m.Scripts + return m.Names } return nil } -type SetScriptsResponse struct { +type RemoveTracepointResponse struct { + Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` } -func (m *SetScriptsResponse) Reset() { *m = SetScriptsResponse{} } -func (*SetScriptsResponse) ProtoMessage() {} -func (*SetScriptsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{25} +func (m *RemoveTracepointResponse) Reset() { *m = RemoveTracepointResponse{} } +func (*RemoveTracepointResponse) ProtoMessage() {} +func (*RemoveTracepointResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{21} } -func (m *SetScriptsResponse) XXX_Unmarshal(b []byte) error { +func (m *RemoveTracepointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RemoveTracepointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SetScriptsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_RemoveTracepointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1499,36 +1491,42 @@ func (m *SetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *SetScriptsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetScriptsResponse.Merge(m, src) +func (m *RemoveTracepointResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveTracepointResponse.Merge(m, src) } -func (m *SetScriptsResponse) XXX_Size() int { +func (m *RemoveTracepointResponse) XXX_Size() int { return m.Size() } -func (m *SetScriptsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SetScriptsResponse.DiscardUnknown(m) +func (m *RemoveTracepointResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveTracepointResponse.DiscardUnknown(m) } -var xxx_messageInfo_SetScriptsResponse proto.InternalMessageInfo +var xxx_messageInfo_RemoveTracepointResponse proto.InternalMessageInfo -type ExecutionStats struct { - ExecutionTimeNs int64 `protobuf:"varint,1,opt,name=execution_time_ns,json=executionTimeNs,proto3" json:"execution_time_ns,omitempty"` - CompilationTimeNs int64 `protobuf:"varint,2,opt,name=compilation_time_ns,json=compilationTimeNs,proto3" json:"compilation_time_ns,omitempty"` - BytesProcessed int64 `protobuf:"varint,3,opt,name=bytes_processed,json=bytesProcessed,proto3" json:"bytes_processed,omitempty"` - RecordsProcessed int64 `protobuf:"varint,4,opt,name=records_processed,json=recordsProcessed,proto3" json:"records_processed,omitempty"` +func (m *RemoveTracepointResponse) GetStatus() *statuspb.Status { + if m != nil { + return m.Status + } + return nil } -func (m *ExecutionStats) Reset() { *m = ExecutionStats{} } -func (*ExecutionStats) ProtoMessage() {} -func (*ExecutionStats) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{26} +type UpdateConfigRequest struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + AgentPodName string `protobuf:"bytes,3,opt,name=agent_pod_name,json=agentPodName,proto3" json:"agent_pod_name,omitempty"` } -func (m *ExecutionStats) XXX_Unmarshal(b []byte) error { + +func (m *UpdateConfigRequest) Reset() { *m = UpdateConfigRequest{} } +func (*UpdateConfigRequest) ProtoMessage() {} +func (*UpdateConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{22} +} +func (m *UpdateConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ExecutionStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ExecutionStats.Marshal(b, m, deterministic) + return xxx_messageInfo_UpdateConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1538,66 +1536,54 @@ func (m *ExecutionStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *ExecutionStats) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecutionStats.Merge(m, src) +func (m *UpdateConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateConfigRequest.Merge(m, src) } -func (m *ExecutionStats) XXX_Size() int { +func (m *UpdateConfigRequest) XXX_Size() int { return m.Size() } -func (m *ExecutionStats) XXX_DiscardUnknown() { - xxx_messageInfo_ExecutionStats.DiscardUnknown(m) +func (m *UpdateConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateConfigRequest.DiscardUnknown(m) } -var xxx_messageInfo_ExecutionStats proto.InternalMessageInfo - -func (m *ExecutionStats) GetExecutionTimeNs() int64 { - if m != nil { - return m.ExecutionTimeNs - } - return 0 -} +var xxx_messageInfo_UpdateConfigRequest proto.InternalMessageInfo -func (m *ExecutionStats) GetCompilationTimeNs() int64 { +func (m *UpdateConfigRequest) GetKey() string { if m != nil { - return m.CompilationTimeNs + return m.Key } - return 0 + return "" } -func (m *ExecutionStats) GetBytesProcessed() int64 { +func (m *UpdateConfigRequest) GetValue() string { if m != nil { - return m.BytesProcessed + return m.Value } - return 0 + return "" } -func (m *ExecutionStats) GetRecordsProcessed() int64 { +func (m *UpdateConfigRequest) GetAgentPodName() string { if m != nil { - return m.RecordsProcessed + return m.AgentPodName } - return 0 + return "" } -type RecordExecutionResultRequest struct { - ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` - Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Types that are valid to be assigned to Result: - // *RecordExecutionResultRequest_Error - // *RecordExecutionResultRequest_ExecutionStats - Result isRecordExecutionResultRequest_Result `protobuf_oneof:"result"` +type UpdateConfigResponse struct { + Status *statuspb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` } -func (m *RecordExecutionResultRequest) Reset() { *m = RecordExecutionResultRequest{} } -func (*RecordExecutionResultRequest) ProtoMessage() {} -func (*RecordExecutionResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{27} +func (m *UpdateConfigResponse) Reset() { *m = UpdateConfigResponse{} } +func (*UpdateConfigResponse) ProtoMessage() {} +func (*UpdateConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{23} } -func (m *RecordExecutionResultRequest) XXX_Unmarshal(b []byte) error { +func (m *UpdateConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RecordExecutionResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UpdateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RecordExecutionResultRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_UpdateConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1607,92 +1593,118 @@ func (m *RecordExecutionResultRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *RecordExecutionResultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordExecutionResultRequest.Merge(m, src) +func (m *UpdateConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateConfigResponse.Merge(m, src) } -func (m *RecordExecutionResultRequest) XXX_Size() int { +func (m *UpdateConfigResponse) XXX_Size() int { return m.Size() } -func (m *RecordExecutionResultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RecordExecutionResultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RecordExecutionResultRequest proto.InternalMessageInfo - -type isRecordExecutionResultRequest_Result interface { - isRecordExecutionResultRequest_Result() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type RecordExecutionResultRequest_Error struct { - Error *statuspb.Status `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` -} -type RecordExecutionResultRequest_ExecutionStats struct { - ExecutionStats *ExecutionStats `protobuf:"bytes,4,opt,name=execution_stats,json=executionStats,proto3,oneof" json:"execution_stats,omitempty"` +func (m *UpdateConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateConfigResponse.DiscardUnknown(m) } -func (*RecordExecutionResultRequest_Error) isRecordExecutionResultRequest_Result() {} -func (*RecordExecutionResultRequest_ExecutionStats) isRecordExecutionResultRequest_Result() {} +var xxx_messageInfo_UpdateConfigResponse proto.InternalMessageInfo -func (m *RecordExecutionResultRequest) GetResult() isRecordExecutionResultRequest_Result { +func (m *UpdateConfigResponse) GetStatus() *statuspb.Status { if m != nil { - return m.Result + return m.Status } return nil } -func (m *RecordExecutionResultRequest) GetScriptID() *uuidpb.UUID { - if m != nil { - return m.ScriptID - } - return nil +type GetScriptsRequest struct { } -func (m *RecordExecutionResultRequest) GetTimestamp() *types.Timestamp { - if m != nil { - return m.Timestamp - } - return nil +func (m *GetScriptsRequest) Reset() { *m = GetScriptsRequest{} } +func (*GetScriptsRequest) ProtoMessage() {} +func (*GetScriptsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{24} } - -func (m *RecordExecutionResultRequest) GetError() *statuspb.Status { - if x, ok := m.GetResult().(*RecordExecutionResultRequest_Error); ok { - return x.Error - } - return nil +func (m *GetScriptsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (m *RecordExecutionResultRequest) GetExecutionStats() *ExecutionStats { - if x, ok := m.GetResult().(*RecordExecutionResultRequest_ExecutionStats); ok { - return x.ExecutionStats - } - return nil +func (m *GetScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetScriptsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetScriptsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetScriptsRequest.Merge(m, src) +} +func (m *GetScriptsRequest) XXX_Size() int { + return m.Size() +} +func (m *GetScriptsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetScriptsRequest.DiscardUnknown(m) } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RecordExecutionResultRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*RecordExecutionResultRequest_Error)(nil), - (*RecordExecutionResultRequest_ExecutionStats)(nil), +var xxx_messageInfo_GetScriptsRequest proto.InternalMessageInfo + +type GetScriptsResponse struct { + Scripts map[string]*cvmsgspb.CronScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *GetScriptsResponse) Reset() { *m = GetScriptsResponse{} } +func (*GetScriptsResponse) ProtoMessage() {} +func (*GetScriptsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{25} +} +func (m *GetScriptsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetScriptsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } } +func (m *GetScriptsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetScriptsResponse.Merge(m, src) +} +func (m *GetScriptsResponse) XXX_Size() int { + return m.Size() +} +func (m *GetScriptsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetScriptsResponse.DiscardUnknown(m) +} -type RecordExecutionResultResponse struct { +var xxx_messageInfo_GetScriptsResponse proto.InternalMessageInfo + +func (m *GetScriptsResponse) GetScripts() map[string]*cvmsgspb.CronScript { + if m != nil { + return m.Scripts + } + return nil } -func (m *RecordExecutionResultResponse) Reset() { *m = RecordExecutionResultResponse{} } -func (*RecordExecutionResultResponse) ProtoMessage() {} -func (*RecordExecutionResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{28} +type AddOrUpdateScriptRequest struct { + Script *cvmsgspb.CronScript `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` } -func (m *RecordExecutionResultResponse) XXX_Unmarshal(b []byte) error { + +func (m *AddOrUpdateScriptRequest) Reset() { *m = AddOrUpdateScriptRequest{} } +func (*AddOrUpdateScriptRequest) ProtoMessage() {} +func (*AddOrUpdateScriptRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{26} +} +func (m *AddOrUpdateScriptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RecordExecutionResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AddOrUpdateScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RecordExecutionResultResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_AddOrUpdateScriptRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1702,32 +1714,39 @@ func (m *RecordExecutionResultResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *RecordExecutionResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RecordExecutionResultResponse.Merge(m, src) +func (m *AddOrUpdateScriptRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddOrUpdateScriptRequest.Merge(m, src) } -func (m *RecordExecutionResultResponse) XXX_Size() int { +func (m *AddOrUpdateScriptRequest) XXX_Size() int { return m.Size() } -func (m *RecordExecutionResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RecordExecutionResultResponse.DiscardUnknown(m) +func (m *AddOrUpdateScriptRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddOrUpdateScriptRequest.DiscardUnknown(m) } -var xxx_messageInfo_RecordExecutionResultResponse proto.InternalMessageInfo +var xxx_messageInfo_AddOrUpdateScriptRequest proto.InternalMessageInfo -type GetAllExecutionResultsRequest struct { +func (m *AddOrUpdateScriptRequest) GetScript() *cvmsgspb.CronScript { + if m != nil { + return m.Script + } + return nil } -func (m *GetAllExecutionResultsRequest) Reset() { *m = GetAllExecutionResultsRequest{} } -func (*GetAllExecutionResultsRequest) ProtoMessage() {} -func (*GetAllExecutionResultsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{29} +type AddOrUpdateScriptResponse struct { } -func (m *GetAllExecutionResultsRequest) XXX_Unmarshal(b []byte) error { + +func (m *AddOrUpdateScriptResponse) Reset() { *m = AddOrUpdateScriptResponse{} } +func (*AddOrUpdateScriptResponse) ProtoMessage() {} +func (*AddOrUpdateScriptResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{27} +} +func (m *AddOrUpdateScriptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetAllExecutionResultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AddOrUpdateScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetAllExecutionResultsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_AddOrUpdateScriptResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1737,33 +1756,33 @@ func (m *GetAllExecutionResultsRequest) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *GetAllExecutionResultsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAllExecutionResultsRequest.Merge(m, src) +func (m *AddOrUpdateScriptResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddOrUpdateScriptResponse.Merge(m, src) } -func (m *GetAllExecutionResultsRequest) XXX_Size() int { +func (m *AddOrUpdateScriptResponse) XXX_Size() int { return m.Size() } -func (m *GetAllExecutionResultsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAllExecutionResultsRequest.DiscardUnknown(m) +func (m *AddOrUpdateScriptResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddOrUpdateScriptResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetAllExecutionResultsRequest proto.InternalMessageInfo +var xxx_messageInfo_AddOrUpdateScriptResponse proto.InternalMessageInfo -type GetAllExecutionResultsResponse struct { - Results []*GetAllExecutionResultsResponse_ExecutionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +type DeleteScriptRequest struct { + ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` } -func (m *GetAllExecutionResultsResponse) Reset() { *m = GetAllExecutionResultsResponse{} } -func (*GetAllExecutionResultsResponse) ProtoMessage() {} -func (*GetAllExecutionResultsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{30} +func (m *DeleteScriptRequest) Reset() { *m = DeleteScriptRequest{} } +func (*DeleteScriptRequest) ProtoMessage() {} +func (*DeleteScriptRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{28} } -func (m *GetAllExecutionResultsResponse) XXX_Unmarshal(b []byte) error { +func (m *DeleteScriptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetAllExecutionResultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeleteScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetAllExecutionResultsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_DeleteScriptRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1773,47 +1792,39 @@ func (m *GetAllExecutionResultsResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *GetAllExecutionResultsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAllExecutionResultsResponse.Merge(m, src) +func (m *DeleteScriptRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteScriptRequest.Merge(m, src) } -func (m *GetAllExecutionResultsResponse) XXX_Size() int { +func (m *DeleteScriptRequest) XXX_Size() int { return m.Size() } -func (m *GetAllExecutionResultsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAllExecutionResultsResponse.DiscardUnknown(m) +func (m *DeleteScriptRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteScriptRequest.DiscardUnknown(m) } -var xxx_messageInfo_GetAllExecutionResultsResponse proto.InternalMessageInfo +var xxx_messageInfo_DeleteScriptRequest proto.InternalMessageInfo -func (m *GetAllExecutionResultsResponse) GetResults() []*GetAllExecutionResultsResponse_ExecutionResult { +func (m *DeleteScriptRequest) GetScriptID() *uuidpb.UUID { if m != nil { - return m.Results + return m.ScriptID } return nil } -type GetAllExecutionResultsResponse_ExecutionResult struct { - ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` - Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Types that are valid to be assigned to Result: - // *GetAllExecutionResultsResponse_ExecutionResult_Error - // *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats - Result isGetAllExecutionResultsResponse_ExecutionResult_Result `protobuf_oneof:"result"` +type DeleteScriptResponse struct { } -func (m *GetAllExecutionResultsResponse_ExecutionResult) Reset() { - *m = GetAllExecutionResultsResponse_ExecutionResult{} -} -func (*GetAllExecutionResultsResponse_ExecutionResult) ProtoMessage() {} -func (*GetAllExecutionResultsResponse_ExecutionResult) Descriptor() ([]byte, []int) { - return fileDescriptor_bfe4468195647430, []int{30, 0} +func (m *DeleteScriptResponse) Reset() { *m = DeleteScriptResponse{} } +func (*DeleteScriptResponse) ProtoMessage() {} +func (*DeleteScriptResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{29} } -func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Unmarshal(b []byte) error { +func (m *DeleteScriptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DeleteScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.Marshal(b, m, deterministic) + return xxx_messageInfo_DeleteScriptResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1823,497 +1834,685 @@ func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Marshal(b []byte, d return b[:n], nil } } -func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.Merge(m, src) +func (m *DeleteScriptResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteScriptResponse.Merge(m, src) } -func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Size() int { +func (m *DeleteScriptResponse) XXX_Size() int { return m.Size() } -func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_DiscardUnknown() { - xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.DiscardUnknown(m) +func (m *DeleteScriptResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteScriptResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult proto.InternalMessageInfo +var xxx_messageInfo_DeleteScriptResponse proto.InternalMessageInfo -type isGetAllExecutionResultsResponse_ExecutionResult_Result interface { - isGetAllExecutionResultsResponse_ExecutionResult_Result() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int +type SetScriptsRequest struct { + Scripts map[string]*cvmsgspb.CronScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -type GetAllExecutionResultsResponse_ExecutionResult_Error struct { - Error *statuspb.Status `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` +func (m *SetScriptsRequest) Reset() { *m = SetScriptsRequest{} } +func (*SetScriptsRequest) ProtoMessage() {} +func (*SetScriptsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{30} } -type GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats struct { - ExecutionStats *ExecutionStats `protobuf:"bytes,4,opt,name=execution_stats,json=executionStats,proto3,oneof" json:"execution_stats,omitempty"` +func (m *SetScriptsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } - -func (*GetAllExecutionResultsResponse_ExecutionResult_Error) isGetAllExecutionResultsResponse_ExecutionResult_Result() { +func (m *SetScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetScriptsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } -func (*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) isGetAllExecutionResultsResponse_ExecutionResult_Result() { +func (m *SetScriptsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetScriptsRequest.Merge(m, src) } - -func (m *GetAllExecutionResultsResponse_ExecutionResult) GetResult() isGetAllExecutionResultsResponse_ExecutionResult_Result { - if m != nil { - return m.Result - } - return nil +func (m *SetScriptsRequest) XXX_Size() int { + return m.Size() +} +func (m *SetScriptsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetScriptsRequest.DiscardUnknown(m) } -func (m *GetAllExecutionResultsResponse_ExecutionResult) GetScriptID() *uuidpb.UUID { +var xxx_messageInfo_SetScriptsRequest proto.InternalMessageInfo + +func (m *SetScriptsRequest) GetScripts() map[string]*cvmsgspb.CronScript { if m != nil { - return m.ScriptID + return m.Scripts } return nil } -func (m *GetAllExecutionResultsResponse_ExecutionResult) GetTimestamp() *types.Timestamp { - if m != nil { - return m.Timestamp - } - return nil +type SetScriptsResponse struct { } -func (m *GetAllExecutionResultsResponse_ExecutionResult) GetError() *statuspb.Status { - if x, ok := m.GetResult().(*GetAllExecutionResultsResponse_ExecutionResult_Error); ok { - return x.Error +func (m *SetScriptsResponse) Reset() { *m = SetScriptsResponse{} } +func (*SetScriptsResponse) ProtoMessage() {} +func (*SetScriptsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{31} +} +func (m *SetScriptsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetScriptsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *SetScriptsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetScriptsResponse.Merge(m, src) +} +func (m *SetScriptsResponse) XXX_Size() int { + return m.Size() +} +func (m *SetScriptsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetScriptsResponse.DiscardUnknown(m) } -func (m *GetAllExecutionResultsResponse_ExecutionResult) GetExecutionStats() *ExecutionStats { - if x, ok := m.GetResult().(*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats); ok { - return x.ExecutionStats - } - return nil +var xxx_messageInfo_SetScriptsResponse proto.InternalMessageInfo + +type ExecutionStats struct { + ExecutionTimeNs int64 `protobuf:"varint,1,opt,name=execution_time_ns,json=executionTimeNs,proto3" json:"execution_time_ns,omitempty"` + CompilationTimeNs int64 `protobuf:"varint,2,opt,name=compilation_time_ns,json=compilationTimeNs,proto3" json:"compilation_time_ns,omitempty"` + BytesProcessed int64 `protobuf:"varint,3,opt,name=bytes_processed,json=bytesProcessed,proto3" json:"bytes_processed,omitempty"` + RecordsProcessed int64 `protobuf:"varint,4,opt,name=records_processed,json=recordsProcessed,proto3" json:"records_processed,omitempty"` } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GetAllExecutionResultsResponse_ExecutionResult) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GetAllExecutionResultsResponse_ExecutionResult_Error)(nil), - (*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats)(nil), +func (m *ExecutionStats) Reset() { *m = ExecutionStats{} } +func (*ExecutionStats) ProtoMessage() {} +func (*ExecutionStats) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{32} +} +func (m *ExecutionStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExecutionStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExecutionStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } } +func (m *ExecutionStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExecutionStats.Merge(m, src) +} +func (m *ExecutionStats) XXX_Size() int { + return m.Size() +} +func (m *ExecutionStats) XXX_DiscardUnknown() { + xxx_messageInfo_ExecutionStats.DiscardUnknown(m) +} -func init() { - proto.RegisterType((*SchemaRequest)(nil), "px.vizier.services.metadata.SchemaRequest") - proto.RegisterType((*SchemaResponse)(nil), "px.vizier.services.metadata.SchemaResponse") - proto.RegisterType((*AgentInfoRequest)(nil), "px.vizier.services.metadata.AgentInfoRequest") - proto.RegisterType((*AgentInfoResponse)(nil), "px.vizier.services.metadata.AgentInfoResponse") - proto.RegisterType((*AgentMetadata)(nil), "px.vizier.services.metadata.AgentMetadata") - proto.RegisterType((*AgentUpdatesRequest)(nil), "px.vizier.services.metadata.AgentUpdatesRequest") - proto.RegisterType((*AgentUpdate)(nil), "px.vizier.services.metadata.AgentUpdate") - proto.RegisterType((*AgentUpdatesResponse)(nil), "px.vizier.services.metadata.AgentUpdatesResponse") - proto.RegisterType((*WithPrefixKeyRequest)(nil), "px.vizier.services.metadata.WithPrefixKeyRequest") - proto.RegisterType((*WithPrefixKeyResponse)(nil), "px.vizier.services.metadata.WithPrefixKeyResponse") - proto.RegisterType((*WithPrefixKeyResponse_KV)(nil), "px.vizier.services.metadata.WithPrefixKeyResponse.KV") - proto.RegisterType((*RegisterTracepointRequest)(nil), "px.vizier.services.metadata.RegisterTracepointRequest") - proto.RegisterType((*RegisterTracepointRequest_TracepointRequest)(nil), "px.vizier.services.metadata.RegisterTracepointRequest.TracepointRequest") - proto.RegisterType((*RegisterTracepointResponse)(nil), "px.vizier.services.metadata.RegisterTracepointResponse") - proto.RegisterType((*RegisterTracepointResponse_TracepointStatus)(nil), "px.vizier.services.metadata.RegisterTracepointResponse.TracepointStatus") - proto.RegisterType((*GetTracepointInfoRequest)(nil), "px.vizier.services.metadata.GetTracepointInfoRequest") - proto.RegisterType((*GetTracepointInfoResponse)(nil), "px.vizier.services.metadata.GetTracepointInfoResponse") - proto.RegisterType((*GetTracepointInfoResponse_TracepointState)(nil), "px.vizier.services.metadata.GetTracepointInfoResponse.TracepointState") - proto.RegisterType((*RemoveTracepointRequest)(nil), "px.vizier.services.metadata.RemoveTracepointRequest") - proto.RegisterType((*RemoveTracepointResponse)(nil), "px.vizier.services.metadata.RemoveTracepointResponse") - proto.RegisterType((*UpdateConfigRequest)(nil), "px.vizier.services.metadata.UpdateConfigRequest") - proto.RegisterType((*UpdateConfigResponse)(nil), "px.vizier.services.metadata.UpdateConfigResponse") - proto.RegisterType((*GetScriptsRequest)(nil), "px.vizier.services.metadata.GetScriptsRequest") - proto.RegisterType((*GetScriptsResponse)(nil), "px.vizier.services.metadata.GetScriptsResponse") - proto.RegisterMapType((map[string]*cvmsgspb.CronScript)(nil), "px.vizier.services.metadata.GetScriptsResponse.ScriptsEntry") - proto.RegisterType((*AddOrUpdateScriptRequest)(nil), "px.vizier.services.metadata.AddOrUpdateScriptRequest") - proto.RegisterType((*AddOrUpdateScriptResponse)(nil), "px.vizier.services.metadata.AddOrUpdateScriptResponse") - proto.RegisterType((*DeleteScriptRequest)(nil), "px.vizier.services.metadata.DeleteScriptRequest") - proto.RegisterType((*DeleteScriptResponse)(nil), "px.vizier.services.metadata.DeleteScriptResponse") - proto.RegisterType((*SetScriptsRequest)(nil), "px.vizier.services.metadata.SetScriptsRequest") - proto.RegisterMapType((map[string]*cvmsgspb.CronScript)(nil), "px.vizier.services.metadata.SetScriptsRequest.ScriptsEntry") - proto.RegisterType((*SetScriptsResponse)(nil), "px.vizier.services.metadata.SetScriptsResponse") - proto.RegisterType((*ExecutionStats)(nil), "px.vizier.services.metadata.ExecutionStats") - proto.RegisterType((*RecordExecutionResultRequest)(nil), "px.vizier.services.metadata.RecordExecutionResultRequest") - proto.RegisterType((*RecordExecutionResultResponse)(nil), "px.vizier.services.metadata.RecordExecutionResultResponse") - proto.RegisterType((*GetAllExecutionResultsRequest)(nil), "px.vizier.services.metadata.GetAllExecutionResultsRequest") - proto.RegisterType((*GetAllExecutionResultsResponse)(nil), "px.vizier.services.metadata.GetAllExecutionResultsResponse") - proto.RegisterType((*GetAllExecutionResultsResponse_ExecutionResult)(nil), "px.vizier.services.metadata.GetAllExecutionResultsResponse.ExecutionResult") +var xxx_messageInfo_ExecutionStats proto.InternalMessageInfo + +func (m *ExecutionStats) GetExecutionTimeNs() int64 { + if m != nil { + return m.ExecutionTimeNs + } + return 0 } -func init() { - proto.RegisterFile("src/vizier/services/metadata/metadatapb/service.proto", fileDescriptor_bfe4468195647430) +func (m *ExecutionStats) GetCompilationTimeNs() int64 { + if m != nil { + return m.CompilationTimeNs + } + return 0 } -var fileDescriptor_bfe4468195647430 = []byte{ - // 2017 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xdd, 0x6f, 0x23, 0x57, - 0x15, 0xf7, 0x78, 0xf2, 0xe1, 0x9c, 0x64, 0xf3, 0x71, 0xe3, 0x6c, 0x1d, 0x2f, 0x75, 0xb6, 0x23, - 0xa0, 0xab, 0x4d, 0x77, 0xa6, 0x6b, 0xba, 0x4d, 0xd9, 0x96, 0xaa, 0x9b, 0xb8, 0x4d, 0xac, 0x6c, - 0xdb, 0x30, 0xce, 0x06, 0x89, 0x17, 0x6b, 0x3c, 0x73, 0xe3, 0x1d, 0xea, 0xf9, 0x60, 0xe6, 0x3a, - 0x24, 0x08, 0x09, 0x84, 0xc4, 0x1b, 0xaa, 0xe8, 0x03, 0x48, 0x7d, 0x03, 0xf1, 0x02, 0xcf, 0xfc, - 0x01, 0x08, 0x9e, 0x78, 0xdc, 0x27, 0x54, 0x21, 0xb4, 0x22, 0xde, 0x17, 0x9e, 0x50, 0xff, 0x04, - 0x74, 0xbf, 0xec, 0xb1, 0x3d, 0xb6, 0xe3, 0x80, 0x78, 0xe2, 0x29, 0x77, 0xce, 0x9c, 0xf3, 0xbb, - 0xe7, 0xfe, 0xce, 0xb9, 0xf7, 0xfe, 0xc6, 0x81, 0x07, 0x71, 0x64, 0x1b, 0x67, 0xee, 0x0f, 0x5d, - 0x1c, 0x19, 0x31, 0x8e, 0xce, 0x5c, 0x1b, 0xc7, 0x86, 0x87, 0x89, 0xe5, 0x58, 0xc4, 0xea, 0x0e, - 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xdb, 0xea, - 0x7b, 0xec, 0x25, 0xe3, 0x07, 0xec, 0xee, 0x58, 0xfb, 0x5c, 0x81, 0x75, 0x36, 0xcb, 0x93, 0xd0, - 0xb1, 0x08, 0x8e, 0x05, 0xa1, 0xa8, 0x0a, 0xeb, 0x9e, 0x75, 0x5e, 0x6f, 0x33, 0x6b, 0xdd, 0xf5, - 0x09, 0x8e, 0xce, 0xac, 0x96, 0x58, 0xf7, 0xa6, 0xce, 0xf7, 0x99, 0x2e, 0xf7, 0x99, 0x5e, 0x11, - 0xfb, 0xd0, 0x5c, 0xf3, 0xac, 0x73, 0x0e, 0x55, 0x15, 0x31, 0x68, 0x07, 0x0a, 0x3d, 0xa8, 0xb8, - 0x1e, 0xe2, 0xa8, 0x1e, 0x89, 0x12, 0x31, 0x22, 0x66, 0xcd, 0x8d, 0x6e, 0x50, 0x7c, 0x84, 0x23, - 0x59, 0x3f, 0xed, 0x5f, 0x0a, 0x2c, 0x26, 0x72, 0x43, 0x3b, 0x90, 0x63, 0xb4, 0xd4, 0x5d, 0x47, - 0x24, 0xb2, 0x42, 0x97, 0xcd, 0x37, 0xb1, 0xfe, 0xe4, 0x49, 0xb5, 0xb2, 0xbb, 0xd8, 0x79, 0xbe, - 0x35, 0xcf, 0x3b, 0xa1, 0x62, 0xce, 0x33, 0xef, 0xaa, 0x83, 0x8a, 0x30, 0xef, 0xe0, 0x16, 0x26, - 0xd8, 0x61, 0x13, 0xe6, 0x0e, 0x32, 0xa6, 0x34, 0xa0, 0x77, 0x65, 0x49, 0xd5, 0x69, 0x4a, 0x7a, - 0x90, 0x91, 0x45, 0x7d, 0x0f, 0x16, 0x68, 0x6b, 0xf0, 0x62, 0xcc, 0x30, 0x8c, 0x57, 0x12, 0x18, - 0xdd, 0x9d, 0xc6, 0xc2, 0x2a, 0x16, 0xb1, 0x28, 0xed, 0x07, 0x19, 0x33, 0xe7, 0x88, 0xf1, 0x6e, - 0x0e, 0xe6, 0x38, 0x37, 0xda, 0x67, 0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0x24, 0xee, 0x57, 0x74, 0x17, 0x54, 0xd7, 0x91, 0x54, 0x0d, 0x21, 0x33, 0xf6, 0xab, - 0x95, 0xd8, 0xa4, 0x4e, 0xda, 0x6f, 0x54, 0xd8, 0x4c, 0x01, 0x12, 0xe4, 0x3f, 0x4d, 0x23, 0xff, - 0x83, 0xb1, 0xe4, 0x8f, 0x04, 0x1b, 0xe0, 0x1e, 0xf7, 0x51, 0x5f, 0xfc, 0x3c, 0x0b, 0x2b, 0x03, - 0x0e, 0x82, 0x20, 0x65, 0x32, 0x41, 0xf7, 0x61, 0x96, 0x72, 0xca, 0xbb, 0x71, 0xb9, 0x7c, 0xab, - 0x8f, 0xf5, 0xc7, 0xee, 0x29, 0xde, 0xbb, 0xb0, 0x5b, 0x98, 0xcf, 0xca, 0x3d, 0x91, 0x01, 0x39, - 0xee, 0x81, 0xe3, 0x82, 0xca, 0x96, 0x95, 0x5a, 0xab, 0xae, 0x53, 0xb7, 0x08, 0x33, 0x89, 0x86, - 0xdf, 0x85, 0x65, 0x7c, 0x1e, 0x62, 0x9b, 0xaa, 0x4b, 0x9e, 0xc0, 0xec, 0xe4, 0x04, 0x6e, 0xc8, - 0x10, 0xbe, 0xc8, 0x57, 0x60, 0x89, 0x1f, 0xc3, 0x75, 0x0a, 0x19, 0x17, 0xe6, 0x6e, 0xab, 0x77, - 0x16, 0xcc, 0x45, 0x6e, 0xfb, 0x88, 0x9a, 0x34, 0x03, 0x5e, 0x32, 0xb1, 0x17, 0x9c, 0xe1, 0xe1, - 0xfd, 0x9f, 0x87, 0x59, 0x1e, 0xa6, 0xb0, 0x30, 0xfe, 0xa0, 0xed, 0x43, 0x61, 0x38, 0x40, 0x94, - 0x74, 0x9a, 0x16, 0xd5, 0x6c, 0x58, 0xe7, 0x17, 0xc0, 0x5e, 0xe0, 0x9f, 0xba, 0x4d, 0x39, 0xeb, - 0x84, 0x73, 0x73, 0x41, 0x9c, 0x9b, 0xf4, 0xd2, 0xe0, 0x17, 0x4d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 0x3a, 0x25, 0xe5, 0x9f, 0x9d, 0x52, 0xe6, 0xcb, 0x4e, 0x49, 0xf9, 0xc5, 0x8b, 0x52, 0xe6, - 0xd9, 0x8b, 0x52, 0xe6, 0x8b, 0x17, 0xa5, 0xcc, 0x77, 0xa1, 0xf7, 0x7f, 0xa7, 0xc6, 0x1c, 0x53, - 0x08, 0xdf, 0xf8, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x26, 0x6f, 0xf1, 0xa9, 0x1a, 0x00, - 0x00, +func (m *ExecutionStats) GetBytesProcessed() int64 { + if m != nil { + return m.BytesProcessed + } + return 0 } -func (this *SchemaRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil +func (m *ExecutionStats) GetRecordsProcessed() int64 { + if m != nil { + return m.RecordsProcessed } + return 0 +} - that1, ok := that.(*SchemaRequest) - if !ok { - that2, ok := that.(SchemaRequest) - if ok { - that1 = &that2 - } else { - return false +type RecordExecutionResultRequest struct { + ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` + Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Types that are valid to be assigned to Result: + // *RecordExecutionResultRequest_Error + // *RecordExecutionResultRequest_ExecutionStats + Result isRecordExecutionResultRequest_Result `protobuf_oneof:"result"` +} + +func (m *RecordExecutionResultRequest) Reset() { *m = RecordExecutionResultRequest{} } +func (*RecordExecutionResultRequest) ProtoMessage() {} +func (*RecordExecutionResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{33} +} +func (m *RecordExecutionResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecordExecutionResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecordExecutionResultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true } -func (this *SchemaResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil +func (m *RecordExecutionResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecordExecutionResultRequest.Merge(m, src) +} +func (m *RecordExecutionResultRequest) XXX_Size() int { + return m.Size() +} +func (m *RecordExecutionResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RecordExecutionResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RecordExecutionResultRequest proto.InternalMessageInfo + +type isRecordExecutionResultRequest_Result interface { + isRecordExecutionResultRequest_Result() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type RecordExecutionResultRequest_Error struct { + Error *statuspb.Status `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` +} +type RecordExecutionResultRequest_ExecutionStats struct { + ExecutionStats *ExecutionStats `protobuf:"bytes,4,opt,name=execution_stats,json=executionStats,proto3,oneof" json:"execution_stats,omitempty"` +} + +func (*RecordExecutionResultRequest_Error) isRecordExecutionResultRequest_Result() {} +func (*RecordExecutionResultRequest_ExecutionStats) isRecordExecutionResultRequest_Result() {} + +func (m *RecordExecutionResultRequest) GetResult() isRecordExecutionResultRequest_Result { + if m != nil { + return m.Result } + return nil +} - that1, ok := that.(*SchemaResponse) - if !ok { - that2, ok := that.(SchemaResponse) - if ok { - that1 = &that2 - } else { - return false - } +func (m *RecordExecutionResultRequest) GetScriptID() *uuidpb.UUID { + if m != nil { + return m.ScriptID } - if that1 == nil { - return this == nil - } else if this == nil { - return false + return nil +} + +func (m *RecordExecutionResultRequest) GetTimestamp() *types.Timestamp { + if m != nil { + return m.Timestamp } - if !this.Schema.Equal(that1.Schema) { - return false + return nil +} + +func (m *RecordExecutionResultRequest) GetError() *statuspb.Status { + if x, ok := m.GetResult().(*RecordExecutionResultRequest_Error); ok { + return x.Error } - return true + return nil } -func (this *AgentInfoRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil + +func (m *RecordExecutionResultRequest) GetExecutionStats() *ExecutionStats { + if x, ok := m.GetResult().(*RecordExecutionResultRequest_ExecutionStats); ok { + return x.ExecutionStats } + return nil +} - that1, ok := that.(*AgentInfoRequest) - if !ok { - that2, ok := that.(AgentInfoRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RecordExecutionResultRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RecordExecutionResultRequest_Error)(nil), + (*RecordExecutionResultRequest_ExecutionStats)(nil), } - return true } -func (this *AgentInfoResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*AgentInfoResponse) - if !ok { - that2, ok := that.(AgentInfoResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Info) != len(that1.Info) { - return false - } - for i := range this.Info { - if !this.Info[i].Equal(that1.Info[i]) { - return false - } - } - return true +type RecordExecutionResultResponse struct { } -func (this *AgentMetadata) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*AgentMetadata) - if !ok { - that2, ok := that.(AgentMetadata) - if ok { - that1 = &that2 - } else { - return false +func (m *RecordExecutionResultResponse) Reset() { *m = RecordExecutionResultResponse{} } +func (*RecordExecutionResultResponse) ProtoMessage() {} +func (*RecordExecutionResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{34} +} +func (m *RecordExecutionResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecordExecutionResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecordExecutionResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Agent.Equal(that1.Agent) { - return false - } - if !this.Status.Equal(that1.Status) { - return false - } - if !this.CarnotInfo.Equal(that1.CarnotInfo) { - return false - } - return true } -func (this *AgentUpdatesRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (m *RecordExecutionResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecordExecutionResultResponse.Merge(m, src) +} +func (m *RecordExecutionResultResponse) XXX_Size() int { + return m.Size() +} +func (m *RecordExecutionResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RecordExecutionResultResponse.DiscardUnknown(m) +} - that1, ok := that.(*AgentUpdatesRequest) - if !ok { - that2, ok := that.(AgentUpdatesRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.MaxUpdateInterval.Equal(that1.MaxUpdateInterval) { - return false - } - if this.MaxUpdatesPerResponse != that1.MaxUpdatesPerResponse { - return false - } - return true +var xxx_messageInfo_RecordExecutionResultResponse proto.InternalMessageInfo + +type GetAllExecutionResultsRequest struct { } -func (this *AgentUpdate) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*AgentUpdate) - if !ok { - that2, ok := that.(AgentUpdate) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.AgentID.Equal(that1.AgentID) { - return false - } - if that1.Update == nil { - if this.Update != nil { - return false +func (m *GetAllExecutionResultsRequest) Reset() { *m = GetAllExecutionResultsRequest{} } +func (*GetAllExecutionResultsRequest) ProtoMessage() {} +func (*GetAllExecutionResultsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{35} +} +func (m *GetAllExecutionResultsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAllExecutionResultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAllExecutionResultsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - } else if this.Update == nil { - return false - } else if !this.Update.Equal(that1.Update) { - return false + return b[:n], nil } - return true } -func (this *AgentUpdate_Deleted) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (m *GetAllExecutionResultsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllExecutionResultsRequest.Merge(m, src) +} +func (m *GetAllExecutionResultsRequest) XXX_Size() int { + return m.Size() +} +func (m *GetAllExecutionResultsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllExecutionResultsRequest.DiscardUnknown(m) +} - that1, ok := that.(*AgentUpdate_Deleted) - if !ok { - that2, ok := that.(AgentUpdate_Deleted) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Deleted != that1.Deleted { - return false - } - return true +var xxx_messageInfo_GetAllExecutionResultsRequest proto.InternalMessageInfo + +type GetAllExecutionResultsResponse struct { + Results []*GetAllExecutionResultsResponse_ExecutionResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (this *AgentUpdate_Agent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - that1, ok := that.(*AgentUpdate_Agent) - if !ok { - that2, ok := that.(AgentUpdate_Agent) - if ok { - that1 = &that2 - } else { - return false +func (m *GetAllExecutionResultsResponse) Reset() { *m = GetAllExecutionResultsResponse{} } +func (*GetAllExecutionResultsResponse) ProtoMessage() {} +func (*GetAllExecutionResultsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{36} +} +func (m *GetAllExecutionResultsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAllExecutionResultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAllExecutionResultsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Agent.Equal(that1.Agent) { - return false - } - return true } -func (this *AgentUpdate_DataInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } +func (m *GetAllExecutionResultsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllExecutionResultsResponse.Merge(m, src) +} +func (m *GetAllExecutionResultsResponse) XXX_Size() int { + return m.Size() +} +func (m *GetAllExecutionResultsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllExecutionResultsResponse.DiscardUnknown(m) +} - that1, ok := that.(*AgentUpdate_DataInfo) - if !ok { - that2, ok := that.(AgentUpdate_DataInfo) +var xxx_messageInfo_GetAllExecutionResultsResponse proto.InternalMessageInfo + +func (m *GetAllExecutionResultsResponse) GetResults() []*GetAllExecutionResultsResponse_ExecutionResult { + if m != nil { + return m.Results + } + return nil +} + +type GetAllExecutionResultsResponse_ExecutionResult struct { + ScriptID *uuidpb.UUID `protobuf:"bytes,1,opt,name=script_id,json=scriptId,proto3" json:"script_id,omitempty"` + Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Types that are valid to be assigned to Result: + // *GetAllExecutionResultsResponse_ExecutionResult_Error + // *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats + Result isGetAllExecutionResultsResponse_ExecutionResult_Result `protobuf_oneof:"result"` +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) Reset() { + *m = GetAllExecutionResultsResponse_ExecutionResult{} +} +func (*GetAllExecutionResultsResponse_ExecutionResult) ProtoMessage() {} +func (*GetAllExecutionResultsResponse_ExecutionResult) Descriptor() ([]byte, []int) { + return fileDescriptor_bfe4468195647430, []int{36, 0} +} +func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.Merge(m, src) +} +func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_Size() int { + return m.Size() +} +func (m *GetAllExecutionResultsResponse_ExecutionResult) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllExecutionResultsResponse_ExecutionResult proto.InternalMessageInfo + +type isGetAllExecutionResultsResponse_ExecutionResult_Result interface { + isGetAllExecutionResultsResponse_ExecutionResult_Result() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type GetAllExecutionResultsResponse_ExecutionResult_Error struct { + Error *statuspb.Status `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` +} +type GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats struct { + ExecutionStats *ExecutionStats `protobuf:"bytes,4,opt,name=execution_stats,json=executionStats,proto3,oneof" json:"execution_stats,omitempty"` +} + +func (*GetAllExecutionResultsResponse_ExecutionResult_Error) isGetAllExecutionResultsResponse_ExecutionResult_Result() { +} +func (*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) isGetAllExecutionResultsResponse_ExecutionResult_Result() { +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) GetResult() isGetAllExecutionResultsResponse_ExecutionResult_Result { + if m != nil { + return m.Result + } + return nil +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) GetScriptID() *uuidpb.UUID { + if m != nil { + return m.ScriptID + } + return nil +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) GetTimestamp() *types.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) GetError() *statuspb.Status { + if x, ok := m.GetResult().(*GetAllExecutionResultsResponse_ExecutionResult_Error); ok { + return x.Error + } + return nil +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) GetExecutionStats() *ExecutionStats { + if x, ok := m.GetResult().(*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats); ok { + return x.ExecutionStats + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GetAllExecutionResultsResponse_ExecutionResult) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*GetAllExecutionResultsResponse_ExecutionResult_Error)(nil), + (*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats)(nil), + } +} + +func init() { + proto.RegisterType((*SchemaRequest)(nil), "px.vizier.services.metadata.SchemaRequest") + proto.RegisterType((*SchemaResponse)(nil), "px.vizier.services.metadata.SchemaResponse") + proto.RegisterType((*AgentInfoRequest)(nil), "px.vizier.services.metadata.AgentInfoRequest") + proto.RegisterType((*AgentInfoResponse)(nil), "px.vizier.services.metadata.AgentInfoResponse") + proto.RegisterType((*AgentMetadata)(nil), "px.vizier.services.metadata.AgentMetadata") + proto.RegisterType((*AgentUpdatesRequest)(nil), "px.vizier.services.metadata.AgentUpdatesRequest") + proto.RegisterType((*AgentUpdate)(nil), "px.vizier.services.metadata.AgentUpdate") + proto.RegisterType((*AgentUpdatesResponse)(nil), "px.vizier.services.metadata.AgentUpdatesResponse") + proto.RegisterType((*WithPrefixKeyRequest)(nil), "px.vizier.services.metadata.WithPrefixKeyRequest") + proto.RegisterType((*WithPrefixKeyResponse)(nil), "px.vizier.services.metadata.WithPrefixKeyResponse") + proto.RegisterType((*WithPrefixKeyResponse_KV)(nil), "px.vizier.services.metadata.WithPrefixKeyResponse.KV") + proto.RegisterType((*RegisterFileSourceRequest)(nil), "px.vizier.services.metadata.RegisterFileSourceRequest") + proto.RegisterType((*RegisterFileSourceResponse)(nil), "px.vizier.services.metadata.RegisterFileSourceResponse") + proto.RegisterType((*RegisterFileSourceResponse_FileSourceStatus)(nil), "px.vizier.services.metadata.RegisterFileSourceResponse.FileSourceStatus") + proto.RegisterType((*GetFileSourceInfoRequest)(nil), "px.vizier.services.metadata.GetFileSourceInfoRequest") + proto.RegisterType((*GetFileSourceInfoResponse)(nil), "px.vizier.services.metadata.GetFileSourceInfoResponse") + proto.RegisterType((*GetFileSourceInfoResponse_FileSourceState)(nil), "px.vizier.services.metadata.GetFileSourceInfoResponse.FileSourceState") + proto.RegisterType((*RemoveFileSourceRequest)(nil), "px.vizier.services.metadata.RemoveFileSourceRequest") + proto.RegisterType((*RemoveFileSourceResponse)(nil), "px.vizier.services.metadata.RemoveFileSourceResponse") + proto.RegisterType((*RegisterTracepointRequest)(nil), "px.vizier.services.metadata.RegisterTracepointRequest") + proto.RegisterType((*RegisterTracepointRequest_TracepointRequest)(nil), "px.vizier.services.metadata.RegisterTracepointRequest.TracepointRequest") + proto.RegisterType((*RegisterTracepointResponse)(nil), "px.vizier.services.metadata.RegisterTracepointResponse") + proto.RegisterType((*RegisterTracepointResponse_TracepointStatus)(nil), "px.vizier.services.metadata.RegisterTracepointResponse.TracepointStatus") + proto.RegisterType((*GetTracepointInfoRequest)(nil), "px.vizier.services.metadata.GetTracepointInfoRequest") + proto.RegisterType((*GetTracepointInfoResponse)(nil), "px.vizier.services.metadata.GetTracepointInfoResponse") + proto.RegisterType((*GetTracepointInfoResponse_TracepointState)(nil), "px.vizier.services.metadata.GetTracepointInfoResponse.TracepointState") + proto.RegisterType((*RemoveTracepointRequest)(nil), "px.vizier.services.metadata.RemoveTracepointRequest") + proto.RegisterType((*RemoveTracepointResponse)(nil), "px.vizier.services.metadata.RemoveTracepointResponse") + proto.RegisterType((*UpdateConfigRequest)(nil), "px.vizier.services.metadata.UpdateConfigRequest") + proto.RegisterType((*UpdateConfigResponse)(nil), "px.vizier.services.metadata.UpdateConfigResponse") + proto.RegisterType((*GetScriptsRequest)(nil), "px.vizier.services.metadata.GetScriptsRequest") + proto.RegisterType((*GetScriptsResponse)(nil), "px.vizier.services.metadata.GetScriptsResponse") + proto.RegisterMapType((map[string]*cvmsgspb.CronScript)(nil), "px.vizier.services.metadata.GetScriptsResponse.ScriptsEntry") + proto.RegisterType((*AddOrUpdateScriptRequest)(nil), "px.vizier.services.metadata.AddOrUpdateScriptRequest") + proto.RegisterType((*AddOrUpdateScriptResponse)(nil), "px.vizier.services.metadata.AddOrUpdateScriptResponse") + proto.RegisterType((*DeleteScriptRequest)(nil), "px.vizier.services.metadata.DeleteScriptRequest") + proto.RegisterType((*DeleteScriptResponse)(nil), "px.vizier.services.metadata.DeleteScriptResponse") + proto.RegisterType((*SetScriptsRequest)(nil), "px.vizier.services.metadata.SetScriptsRequest") + proto.RegisterMapType((map[string]*cvmsgspb.CronScript)(nil), "px.vizier.services.metadata.SetScriptsRequest.ScriptsEntry") + proto.RegisterType((*SetScriptsResponse)(nil), "px.vizier.services.metadata.SetScriptsResponse") + proto.RegisterType((*ExecutionStats)(nil), "px.vizier.services.metadata.ExecutionStats") + proto.RegisterType((*RecordExecutionResultRequest)(nil), "px.vizier.services.metadata.RecordExecutionResultRequest") + proto.RegisterType((*RecordExecutionResultResponse)(nil), "px.vizier.services.metadata.RecordExecutionResultResponse") + proto.RegisterType((*GetAllExecutionResultsRequest)(nil), "px.vizier.services.metadata.GetAllExecutionResultsRequest") + proto.RegisterType((*GetAllExecutionResultsResponse)(nil), "px.vizier.services.metadata.GetAllExecutionResultsResponse") + proto.RegisterType((*GetAllExecutionResultsResponse_ExecutionResult)(nil), "px.vizier.services.metadata.GetAllExecutionResultsResponse.ExecutionResult") +} + +func init() { + proto.RegisterFile("src/vizier/services/metadata/metadatapb/service.proto", fileDescriptor_bfe4468195647430) +} + +var fileDescriptor_bfe4468195647430 = []byte{ + // 2204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 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, 0xda, 0xcd, 0x7d, 0xe3, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xa6, 0x68, 0x46, 0x22, 0x95, 0x20, 0x00, 0x00, +} + +func (this *SchemaRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SchemaRequest) + if !ok { + that2, ok := that.(SchemaRequest) if ok { that1 = &that2 } else { @@ -2325,19 +2524,16 @@ func (this *AgentUpdate_DataInfo) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.DataInfo.Equal(that1.DataInfo) { - return false - } return true } -func (this *AgentUpdatesResponse) Equal(that interface{}) bool { +func (this *SchemaResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*AgentUpdatesResponse) + that1, ok := that.(*SchemaResponse) if !ok { - that2, ok := that.(AgentUpdatesResponse) + that2, ok := that.(SchemaResponse) if ok { that1 = &that2 } else { @@ -2349,38 +2545,19 @@ func (this *AgentUpdatesResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.AgentUpdates) != len(that1.AgentUpdates) { - return false - } - for i := range this.AgentUpdates { - if !this.AgentUpdates[i].Equal(that1.AgentUpdates[i]) { - return false - } - } - if len(this.AgentSchemas) != len(that1.AgentSchemas) { - return false - } - for i := range this.AgentSchemas { - if !this.AgentSchemas[i].Equal(that1.AgentSchemas[i]) { - return false - } - } - if this.AgentSchemasUpdated != that1.AgentSchemasUpdated { - return false - } - if this.EndOfVersion != that1.EndOfVersion { + if !this.Schema.Equal(that1.Schema) { return false } return true } -func (this *WithPrefixKeyRequest) Equal(that interface{}) bool { +func (this *AgentInfoRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*WithPrefixKeyRequest) + that1, ok := that.(*AgentInfoRequest) if !ok { - that2, ok := that.(WithPrefixKeyRequest) + that2, ok := that.(AgentInfoRequest) if ok { that1 = &that2 } else { @@ -2392,22 +2569,16 @@ func (this *WithPrefixKeyRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Prefix != that1.Prefix { - return false - } - if this.Proto != that1.Proto { - return false - } return true } -func (this *WithPrefixKeyResponse) Equal(that interface{}) bool { +func (this *AgentInfoResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*WithPrefixKeyResponse) + that1, ok := that.(*AgentInfoResponse) if !ok { - that2, ok := that.(WithPrefixKeyResponse) + that2, ok := that.(AgentInfoResponse) if ok { that1 = &that2 } else { @@ -2419,24 +2590,24 @@ func (this *WithPrefixKeyResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Kvs) != len(that1.Kvs) { + if len(this.Info) != len(that1.Info) { return false } - for i := range this.Kvs { - if !this.Kvs[i].Equal(that1.Kvs[i]) { + for i := range this.Info { + if !this.Info[i].Equal(that1.Info[i]) { return false } } return true } -func (this *WithPrefixKeyResponse_KV) Equal(that interface{}) bool { +func (this *AgentMetadata) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*WithPrefixKeyResponse_KV) + that1, ok := that.(*AgentMetadata) if !ok { - that2, ok := that.(WithPrefixKeyResponse_KV) + that2, ok := that.(AgentMetadata) if ok { that1 = &that2 } else { @@ -2448,22 +2619,25 @@ func (this *WithPrefixKeyResponse_KV) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Key != that1.Key { + if !this.Agent.Equal(that1.Agent) { return false } - if !bytes.Equal(this.Value, that1.Value) { + if !this.Status.Equal(that1.Status) { + return false + } + if !this.CarnotInfo.Equal(that1.CarnotInfo) { return false } return true } -func (this *RegisterTracepointRequest) Equal(that interface{}) bool { +func (this *AgentUpdatesRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RegisterTracepointRequest) + that1, ok := that.(*AgentUpdatesRequest) if !ok { - that2, ok := that.(RegisterTracepointRequest) + that2, ok := that.(AgentUpdatesRequest) if ok { that1 = &that2 } else { @@ -2475,24 +2649,22 @@ func (this *RegisterTracepointRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Requests) != len(that1.Requests) { + if !this.MaxUpdateInterval.Equal(that1.MaxUpdateInterval) { return false } - for i := range this.Requests { - if !this.Requests[i].Equal(that1.Requests[i]) { - return false - } + if this.MaxUpdatesPerResponse != that1.MaxUpdatesPerResponse { + return false } return true } -func (this *RegisterTracepointRequest_TracepointRequest) Equal(that interface{}) bool { +func (this *AgentUpdate) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RegisterTracepointRequest_TracepointRequest) + that1, ok := that.(*AgentUpdate) if !ok { - that2, ok := that.(RegisterTracepointRequest_TracepointRequest) + that2, ok := that.(AgentUpdate) if ok { that1 = &that2 } else { @@ -2504,25 +2676,28 @@ func (this *RegisterTracepointRequest_TracepointRequest) Equal(that interface{}) } else if this == nil { return false } - if !this.TracepointDeployment.Equal(that1.TracepointDeployment) { + if !this.AgentID.Equal(that1.AgentID) { return false } - if this.Name != that1.Name { + if that1.Update == nil { + if this.Update != nil { + return false + } + } else if this.Update == nil { return false - } - if !this.TTL.Equal(that1.TTL) { + } else if !this.Update.Equal(that1.Update) { return false } return true } -func (this *RegisterTracepointResponse) Equal(that interface{}) bool { +func (this *AgentUpdate_Deleted) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RegisterTracepointResponse) + that1, ok := that.(*AgentUpdate_Deleted) if !ok { - that2, ok := that.(RegisterTracepointResponse) + that2, ok := that.(AgentUpdate_Deleted) if ok { that1 = &that2 } else { @@ -2534,27 +2709,19 @@ func (this *RegisterTracepointResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Tracepoints) != len(that1.Tracepoints) { - return false - } - for i := range this.Tracepoints { - if !this.Tracepoints[i].Equal(that1.Tracepoints[i]) { - return false - } - } - if !this.Status.Equal(that1.Status) { + if this.Deleted != that1.Deleted { return false } return true } -func (this *RegisterTracepointResponse_TracepointStatus) Equal(that interface{}) bool { +func (this *AgentUpdate_Agent) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RegisterTracepointResponse_TracepointStatus) + that1, ok := that.(*AgentUpdate_Agent) if !ok { - that2, ok := that.(RegisterTracepointResponse_TracepointStatus) + that2, ok := that.(AgentUpdate_Agent) if ok { that1 = &that2 } else { @@ -2566,25 +2733,19 @@ func (this *RegisterTracepointResponse_TracepointStatus) Equal(that interface{}) } else if this == nil { return false } - if !this.Status.Equal(that1.Status) { - return false - } - if !this.ID.Equal(that1.ID) { - return false - } - if this.Name != that1.Name { + if !this.Agent.Equal(that1.Agent) { return false } return true } -func (this *GetTracepointInfoRequest) Equal(that interface{}) bool { +func (this *AgentUpdate_DataInfo) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetTracepointInfoRequest) + that1, ok := that.(*AgentUpdate_DataInfo) if !ok { - that2, ok := that.(GetTracepointInfoRequest) + that2, ok := that.(AgentUpdate_DataInfo) if ok { that1 = &that2 } else { @@ -2596,24 +2757,19 @@ func (this *GetTracepointInfoRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.IDs) != len(that1.IDs) { + if !this.DataInfo.Equal(that1.DataInfo) { return false } - for i := range this.IDs { - if !this.IDs[i].Equal(that1.IDs[i]) { - return false - } - } return true } -func (this *GetTracepointInfoResponse) Equal(that interface{}) bool { +func (this *AgentUpdatesResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetTracepointInfoResponse) + that1, ok := that.(*AgentUpdatesResponse) if !ok { - that2, ok := that.(GetTracepointInfoResponse) + that2, ok := that.(AgentUpdatesResponse) if ok { that1 = &that2 } else { @@ -2625,24 +2781,38 @@ func (this *GetTracepointInfoResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Tracepoints) != len(that1.Tracepoints) { + if len(this.AgentUpdates) != len(that1.AgentUpdates) { return false } - for i := range this.Tracepoints { - if !this.Tracepoints[i].Equal(that1.Tracepoints[i]) { + for i := range this.AgentUpdates { + if !this.AgentUpdates[i].Equal(that1.AgentUpdates[i]) { + return false + } + } + if len(this.AgentSchemas) != len(that1.AgentSchemas) { + return false + } + for i := range this.AgentSchemas { + if !this.AgentSchemas[i].Equal(that1.AgentSchemas[i]) { return false } } + if this.AgentSchemasUpdated != that1.AgentSchemasUpdated { + return false + } + if this.EndOfVersion != that1.EndOfVersion { + return false + } return true } -func (this *GetTracepointInfoResponse_TracepointState) Equal(that interface{}) bool { +func (this *WithPrefixKeyRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetTracepointInfoResponse_TracepointState) + that1, ok := that.(*WithPrefixKeyRequest) if !ok { - that2, ok := that.(GetTracepointInfoResponse_TracepointState) + that2, ok := that.(WithPrefixKeyRequest) if ok { that1 = &that2 } else { @@ -2654,44 +2824,22 @@ func (this *GetTracepointInfoResponse_TracepointState) Equal(that interface{}) b } else if this == nil { return false } - if !this.ID.Equal(that1.ID) { - return false - } - if this.State != that1.State { - return false - } - if len(this.Statuses) != len(that1.Statuses) { - return false - } - for i := range this.Statuses { - if !this.Statuses[i].Equal(that1.Statuses[i]) { - return false - } - } - if this.Name != that1.Name { - return false - } - if this.ExpectedState != that1.ExpectedState { + if this.Prefix != that1.Prefix { return false } - if len(this.SchemaNames) != len(that1.SchemaNames) { + if this.Proto != that1.Proto { return false } - for i := range this.SchemaNames { - if this.SchemaNames[i] != that1.SchemaNames[i] { - return false - } - } return true } -func (this *RemoveTracepointRequest) Equal(that interface{}) bool { +func (this *WithPrefixKeyResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RemoveTracepointRequest) + that1, ok := that.(*WithPrefixKeyResponse) if !ok { - that2, ok := that.(RemoveTracepointRequest) + that2, ok := that.(WithPrefixKeyResponse) if ok { that1 = &that2 } else { @@ -2703,24 +2851,24 @@ func (this *RemoveTracepointRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Names) != len(that1.Names) { + if len(this.Kvs) != len(that1.Kvs) { return false } - for i := range this.Names { - if this.Names[i] != that1.Names[i] { + for i := range this.Kvs { + if !this.Kvs[i].Equal(that1.Kvs[i]) { return false } } return true } -func (this *RemoveTracepointResponse) Equal(that interface{}) bool { +func (this *WithPrefixKeyResponse_KV) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RemoveTracepointResponse) + that1, ok := that.(*WithPrefixKeyResponse_KV) if !ok { - that2, ok := that.(RemoveTracepointResponse) + that2, ok := that.(WithPrefixKeyResponse_KV) if ok { that1 = &that2 } else { @@ -2732,19 +2880,22 @@ func (this *RemoveTracepointResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.Status.Equal(that1.Status) { + if this.Key != that1.Key { + return false + } + if !bytes.Equal(this.Value, that1.Value) { return false } return true } -func (this *UpdateConfigRequest) Equal(that interface{}) bool { +func (this *RegisterFileSourceRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*UpdateConfigRequest) + that1, ok := that.(*RegisterFileSourceRequest) if !ok { - that2, ok := that.(UpdateConfigRequest) + that2, ok := that.(RegisterFileSourceRequest) if ok { that1 = &that2 } else { @@ -2756,25 +2907,24 @@ func (this *UpdateConfigRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Key != that1.Key { - return false - } - if this.Value != that1.Value { + if len(this.Requests) != len(that1.Requests) { return false } - if this.AgentPodName != that1.AgentPodName { - return false + for i := range this.Requests { + if !this.Requests[i].Equal(that1.Requests[i]) { + return false + } } return true } -func (this *UpdateConfigResponse) Equal(that interface{}) bool { +func (this *RegisterFileSourceResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*UpdateConfigResponse) + that1, ok := that.(*RegisterFileSourceResponse) if !ok { - that2, ok := that.(UpdateConfigResponse) + that2, ok := that.(RegisterFileSourceResponse) if ok { that1 = &that2 } else { @@ -2786,19 +2936,27 @@ func (this *UpdateConfigResponse) Equal(that interface{}) bool { } else if this == nil { return false } + if len(this.FileSources) != len(that1.FileSources) { + return false + } + for i := range this.FileSources { + if !this.FileSources[i].Equal(that1.FileSources[i]) { + return false + } + } if !this.Status.Equal(that1.Status) { return false } return true } -func (this *GetScriptsRequest) Equal(that interface{}) bool { +func (this *RegisterFileSourceResponse_FileSourceStatus) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetScriptsRequest) + that1, ok := that.(*RegisterFileSourceResponse_FileSourceStatus) if !ok { - that2, ok := that.(GetScriptsRequest) + that2, ok := that.(RegisterFileSourceResponse_FileSourceStatus) if ok { that1 = &that2 } else { @@ -2810,16 +2968,25 @@ func (this *GetScriptsRequest) Equal(that interface{}) bool { } else if this == nil { return false } + if !this.Status.Equal(that1.Status) { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + if this.Name != that1.Name { + return false + } return true } -func (this *GetScriptsResponse) Equal(that interface{}) bool { +func (this *GetFileSourceInfoRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetScriptsResponse) + that1, ok := that.(*GetFileSourceInfoRequest) if !ok { - that2, ok := that.(GetScriptsResponse) + that2, ok := that.(GetFileSourceInfoRequest) if ok { that1 = &that2 } else { @@ -2831,24 +2998,24 @@ func (this *GetScriptsResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Scripts) != len(that1.Scripts) { + if len(this.IDs) != len(that1.IDs) { return false } - for i := range this.Scripts { - if !this.Scripts[i].Equal(that1.Scripts[i]) { + for i := range this.IDs { + if !this.IDs[i].Equal(that1.IDs[i]) { return false } } return true } -func (this *AddOrUpdateScriptRequest) Equal(that interface{}) bool { +func (this *GetFileSourceInfoResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*AddOrUpdateScriptRequest) + that1, ok := that.(*GetFileSourceInfoResponse) if !ok { - that2, ok := that.(AddOrUpdateScriptRequest) + that2, ok := that.(GetFileSourceInfoResponse) if ok { that1 = &that2 } else { @@ -2860,19 +3027,24 @@ func (this *AddOrUpdateScriptRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.Script.Equal(that1.Script) { + if len(this.FileSources) != len(that1.FileSources) { return false } + for i := range this.FileSources { + if !this.FileSources[i].Equal(that1.FileSources[i]) { + return false + } + } return true } -func (this *AddOrUpdateScriptResponse) Equal(that interface{}) bool { +func (this *GetFileSourceInfoResponse_FileSourceState) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*AddOrUpdateScriptResponse) + that1, ok := that.(*GetFileSourceInfoResponse_FileSourceState) if !ok { - that2, ok := that.(AddOrUpdateScriptResponse) + that2, ok := that.(GetFileSourceInfoResponse_FileSourceState) if ok { that1 = &that2 } else { @@ -2884,16 +3056,44 @@ func (this *AddOrUpdateScriptResponse) Equal(that interface{}) bool { } else if this == nil { return false } + if !this.ID.Equal(that1.ID) { + return false + } + if this.State != that1.State { + return false + } + if len(this.Statuses) != len(that1.Statuses) { + return false + } + for i := range this.Statuses { + if !this.Statuses[i].Equal(that1.Statuses[i]) { + return false + } + } + if this.Name != that1.Name { + return false + } + if this.ExpectedState != that1.ExpectedState { + return false + } + if len(this.SchemaNames) != len(that1.SchemaNames) { + return false + } + for i := range this.SchemaNames { + if this.SchemaNames[i] != that1.SchemaNames[i] { + return false + } + } return true } -func (this *DeleteScriptRequest) Equal(that interface{}) bool { +func (this *RemoveFileSourceRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*DeleteScriptRequest) + that1, ok := that.(*RemoveFileSourceRequest) if !ok { - that2, ok := that.(DeleteScriptRequest) + that2, ok := that.(RemoveFileSourceRequest) if ok { that1 = &that2 } else { @@ -2905,19 +3105,24 @@ func (this *DeleteScriptRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.ScriptID.Equal(that1.ScriptID) { + if len(this.Names) != len(that1.Names) { return false } + for i := range this.Names { + if this.Names[i] != that1.Names[i] { + return false + } + } return true } -func (this *DeleteScriptResponse) Equal(that interface{}) bool { +func (this *RemoveFileSourceResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*DeleteScriptResponse) + that1, ok := that.(*RemoveFileSourceResponse) if !ok { - that2, ok := that.(DeleteScriptResponse) + that2, ok := that.(RemoveFileSourceResponse) if ok { that1 = &that2 } else { @@ -2929,16 +3134,19 @@ func (this *DeleteScriptResponse) Equal(that interface{}) bool { } else if this == nil { return false } + if !this.Status.Equal(that1.Status) { + return false + } return true } -func (this *SetScriptsRequest) Equal(that interface{}) bool { +func (this *RegisterTracepointRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*SetScriptsRequest) + that1, ok := that.(*RegisterTracepointRequest) if !ok { - that2, ok := that.(SetScriptsRequest) + that2, ok := that.(RegisterTracepointRequest) if ok { that1 = &that2 } else { @@ -2950,24 +3158,24 @@ func (this *SetScriptsRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Scripts) != len(that1.Scripts) { + if len(this.Requests) != len(that1.Requests) { return false } - for i := range this.Scripts { - if !this.Scripts[i].Equal(that1.Scripts[i]) { + for i := range this.Requests { + if !this.Requests[i].Equal(that1.Requests[i]) { return false } } return true } -func (this *SetScriptsResponse) Equal(that interface{}) bool { +func (this *RegisterTracepointRequest_TracepointRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*SetScriptsResponse) + that1, ok := that.(*RegisterTracepointRequest_TracepointRequest) if !ok { - that2, ok := that.(SetScriptsResponse) + that2, ok := that.(RegisterTracepointRequest_TracepointRequest) if ok { that1 = &that2 } else { @@ -2979,16 +3187,25 @@ func (this *SetScriptsResponse) Equal(that interface{}) bool { } else if this == nil { return false } - return true -} -func (this *ExecutionStats) Equal(that interface{}) bool { - if that == nil { - return this == nil + if !this.TracepointDeployment.Equal(that1.TracepointDeployment) { + return false + } + if this.Name != that1.Name { + return false + } + if !this.TTL.Equal(that1.TTL) { + return false + } + return true +} +func (this *RegisterTracepointResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - that1, ok := that.(*ExecutionStats) + that1, ok := that.(*RegisterTracepointResponse) if !ok { - that2, ok := that.(ExecutionStats) + that2, ok := that.(RegisterTracepointResponse) if ok { that1 = &that2 } else { @@ -3000,28 +3217,27 @@ func (this *ExecutionStats) Equal(that interface{}) bool { } else if this == nil { return false } - if this.ExecutionTimeNs != that1.ExecutionTimeNs { - return false - } - if this.CompilationTimeNs != that1.CompilationTimeNs { + if len(this.Tracepoints) != len(that1.Tracepoints) { return false } - if this.BytesProcessed != that1.BytesProcessed { - return false + for i := range this.Tracepoints { + if !this.Tracepoints[i].Equal(that1.Tracepoints[i]) { + return false + } } - if this.RecordsProcessed != that1.RecordsProcessed { + if !this.Status.Equal(that1.Status) { return false } return true } -func (this *RecordExecutionResultRequest) Equal(that interface{}) bool { +func (this *RegisterTracepointResponse_TracepointStatus) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RecordExecutionResultRequest) + that1, ok := that.(*RegisterTracepointResponse_TracepointStatus) if !ok { - that2, ok := that.(RecordExecutionResultRequest) + that2, ok := that.(RegisterTracepointResponse_TracepointStatus) if ok { that1 = &that2 } else { @@ -3033,31 +3249,54 @@ func (this *RecordExecutionResultRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.ScriptID.Equal(that1.ScriptID) { + if !this.Status.Equal(that1.Status) { return false } - if !this.Timestamp.Equal(that1.Timestamp) { + if !this.ID.Equal(that1.ID) { return false } - if that1.Result == nil { - if this.Result != nil { + if this.Name != that1.Name { + return false + } + return true +} +func (this *GetTracepointInfoRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetTracepointInfoRequest) + if !ok { + that2, ok := that.(GetTracepointInfoRequest) + if ok { + that1 = &that2 + } else { return false } - } else if this.Result == nil { + } + if that1 == nil { + return this == nil + } else if this == nil { return false - } else if !this.Result.Equal(that1.Result) { + } + if len(this.IDs) != len(that1.IDs) { return false } + for i := range this.IDs { + if !this.IDs[i].Equal(that1.IDs[i]) { + return false + } + } return true } -func (this *RecordExecutionResultRequest_Error) Equal(that interface{}) bool { +func (this *GetTracepointInfoResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RecordExecutionResultRequest_Error) + that1, ok := that.(*GetTracepointInfoResponse) if !ok { - that2, ok := that.(RecordExecutionResultRequest_Error) + that2, ok := that.(GetTracepointInfoResponse) if ok { that1 = &that2 } else { @@ -3069,19 +3308,24 @@ func (this *RecordExecutionResultRequest_Error) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.Error.Equal(that1.Error) { + if len(this.Tracepoints) != len(that1.Tracepoints) { return false } + for i := range this.Tracepoints { + if !this.Tracepoints[i].Equal(that1.Tracepoints[i]) { + return false + } + } return true } -func (this *RecordExecutionResultRequest_ExecutionStats) Equal(that interface{}) bool { +func (this *GetTracepointInfoResponse_TracepointState) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RecordExecutionResultRequest_ExecutionStats) + that1, ok := that.(*GetTracepointInfoResponse_TracepointState) if !ok { - that2, ok := that.(RecordExecutionResultRequest_ExecutionStats) + that2, ok := that.(GetTracepointInfoResponse_TracepointState) if ok { that1 = &that2 } else { @@ -3093,19 +3337,44 @@ func (this *RecordExecutionResultRequest_ExecutionStats) Equal(that interface{}) } else if this == nil { return false } - if !this.ExecutionStats.Equal(that1.ExecutionStats) { + if !this.ID.Equal(that1.ID) { + return false + } + if this.State != that1.State { return false } + if len(this.Statuses) != len(that1.Statuses) { + return false + } + for i := range this.Statuses { + if !this.Statuses[i].Equal(that1.Statuses[i]) { + return false + } + } + if this.Name != that1.Name { + return false + } + if this.ExpectedState != that1.ExpectedState { + return false + } + if len(this.SchemaNames) != len(that1.SchemaNames) { + return false + } + for i := range this.SchemaNames { + if this.SchemaNames[i] != that1.SchemaNames[i] { + return false + } + } return true } -func (this *RecordExecutionResultResponse) Equal(that interface{}) bool { +func (this *RemoveTracepointRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*RecordExecutionResultResponse) + that1, ok := that.(*RemoveTracepointRequest) if !ok { - that2, ok := that.(RecordExecutionResultResponse) + that2, ok := that.(RemoveTracepointRequest) if ok { that1 = &that2 } else { @@ -3117,16 +3386,24 @@ func (this *RecordExecutionResultResponse) Equal(that interface{}) bool { } else if this == nil { return false } + if len(this.Names) != len(that1.Names) { + return false + } + for i := range this.Names { + if this.Names[i] != that1.Names[i] { + return false + } + } return true } -func (this *GetAllExecutionResultsRequest) Equal(that interface{}) bool { +func (this *RemoveTracepointResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetAllExecutionResultsRequest) + that1, ok := that.(*RemoveTracepointResponse) if !ok { - that2, ok := that.(GetAllExecutionResultsRequest) + that2, ok := that.(RemoveTracepointResponse) if ok { that1 = &that2 } else { @@ -3138,16 +3415,19 @@ func (this *GetAllExecutionResultsRequest) Equal(that interface{}) bool { } else if this == nil { return false } + if !this.Status.Equal(that1.Status) { + return false + } return true } -func (this *GetAllExecutionResultsResponse) Equal(that interface{}) bool { +func (this *UpdateConfigRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetAllExecutionResultsResponse) + that1, ok := that.(*UpdateConfigRequest) if !ok { - that2, ok := that.(GetAllExecutionResultsResponse) + that2, ok := that.(UpdateConfigRequest) if ok { that1 = &that2 } else { @@ -3159,24 +3439,25 @@ func (this *GetAllExecutionResultsResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Results) != len(that1.Results) { + if this.Key != that1.Key { return false } - for i := range this.Results { - if !this.Results[i].Equal(that1.Results[i]) { - return false - } + if this.Value != that1.Value { + return false + } + if this.AgentPodName != that1.AgentPodName { + return false } return true } -func (this *GetAllExecutionResultsResponse_ExecutionResult) Equal(that interface{}) bool { +func (this *UpdateConfigResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult) + that1, ok := that.(*UpdateConfigResponse) if !ok { - that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult) + that2, ok := that.(UpdateConfigResponse) if ok { that1 = &that2 } else { @@ -3188,31 +3469,40 @@ func (this *GetAllExecutionResultsResponse_ExecutionResult) Equal(that interface } else if this == nil { return false } - if !this.ScriptID.Equal(that1.ScriptID) { + if !this.Status.Equal(that1.Status) { return false } - if !this.Timestamp.Equal(that1.Timestamp) { - return false + return true +} +func (this *GetScriptsRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - if that1.Result == nil { - if this.Result != nil { + + that1, ok := that.(*GetScriptsRequest) + if !ok { + that2, ok := that.(GetScriptsRequest) + if ok { + that1 = &that2 + } else { return false } - } else if this.Result == nil { - return false - } else if !this.Result.Equal(that1.Result) { + } + if that1 == nil { + return this == nil + } else if this == nil { return false } return true } -func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) Equal(that interface{}) bool { +func (this *GetScriptsResponse) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult_Error) + that1, ok := that.(*GetScriptsResponse) if !ok { - that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult_Error) + that2, ok := that.(GetScriptsResponse) if ok { that1 = &that2 } else { @@ -3224,19 +3514,24 @@ func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) Equal(that int } else if this == nil { return false } - if !this.Error.Equal(that1.Error) { + if len(this.Scripts) != len(that1.Scripts) { return false } + for i := range this.Scripts { + if !this.Scripts[i].Equal(that1.Scripts[i]) { + return false + } + } return true } -func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) Equal(that interface{}) bool { +func (this *AddOrUpdateScriptRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) + that1, ok := that.(*AddOrUpdateScriptRequest) if !ok { - that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) + that2, ok := that.(AddOrUpdateScriptRequest) if ok { that1 = &that2 } else { @@ -3248,1659 +3543,1871 @@ func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) Equal } else if this == nil { return false } - if !this.ExecutionStats.Equal(that1.ExecutionStats) { + if !this.Script.Equal(that1.Script) { return false } return true } -func (this *SchemaRequest) GoString() string { - if this == nil { - return "nil" +func (this *AddOrUpdateScriptResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.SchemaRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SchemaResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*AddOrUpdateScriptResponse) + if !ok { + that2, ok := that.(AddOrUpdateScriptResponse) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.SchemaResponse{") - if this.Schema != nil { - s = append(s, "Schema: "+fmt.Sprintf("%#v", this.Schema)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *AgentInfoRequest) GoString() string { - if this == nil { - return "nil" +func (this *DeleteScriptRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.AgentInfoRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AgentInfoResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*DeleteScriptRequest) + if !ok { + that2, ok := that.(DeleteScriptRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.AgentInfoResponse{") - if this.Info != nil { - s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AgentMetadata) GoString() string { - if this == nil { - return "nil" + if !this.ScriptID.Equal(that1.ScriptID) { + return false } - s := make([]string, 0, 7) - s = append(s, "&metadatapb.AgentMetadata{") - if this.Agent != nil { - s = append(s, "Agent: "+fmt.Sprintf("%#v", this.Agent)+",\n") + return true +} +func (this *DeleteScriptResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + + that1, ok := that.(*DeleteScriptResponse) + if !ok { + that2, ok := that.(DeleteScriptResponse) + if ok { + that1 = &that2 + } else { + return false + } } - if this.CarnotInfo != nil { - s = append(s, "CarnotInfo: "+fmt.Sprintf("%#v", this.CarnotInfo)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *AgentUpdatesRequest) GoString() string { - if this == nil { - return "nil" +func (this *SetScriptsRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 6) - s = append(s, "&metadatapb.AgentUpdatesRequest{") - if this.MaxUpdateInterval != nil { - s = append(s, "MaxUpdateInterval: "+fmt.Sprintf("%#v", this.MaxUpdateInterval)+",\n") + + that1, ok := that.(*SetScriptsRequest) + if !ok { + that2, ok := that.(SetScriptsRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s = append(s, "MaxUpdatesPerResponse: "+fmt.Sprintf("%#v", this.MaxUpdatesPerResponse)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AgentUpdate) GoString() string { - if this == nil { - return "nil" + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s := make([]string, 0, 8) - s = append(s, "&metadatapb.AgentUpdate{") - if this.AgentID != nil { - s = append(s, "AgentID: "+fmt.Sprintf("%#v", this.AgentID)+",\n") + if len(this.Scripts) != len(that1.Scripts) { + return false } - if this.Update != nil { - s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") + for i := range this.Scripts { + if !this.Scripts[i].Equal(that1.Scripts[i]) { + return false + } } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *AgentUpdate_Deleted) GoString() string { - if this == nil { - return "nil" +func (this *SetScriptsResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := strings.Join([]string{`&metadatapb.AgentUpdate_Deleted{` + - `Deleted:` + fmt.Sprintf("%#v", this.Deleted) + `}`}, ", ") - return s -} -func (this *AgentUpdate_Agent) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*SetScriptsResponse) + if !ok { + that2, ok := that.(SetScriptsResponse) + if ok { + that1 = &that2 + } else { + return false + } } - s := strings.Join([]string{`&metadatapb.AgentUpdate_Agent{` + - `Agent:` + fmt.Sprintf("%#v", this.Agent) + `}`}, ", ") - return s -} -func (this *AgentUpdate_DataInfo) GoString() string { - if this == nil { - return "nil" + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s := strings.Join([]string{`&metadatapb.AgentUpdate_DataInfo{` + - `DataInfo:` + fmt.Sprintf("%#v", this.DataInfo) + `}`}, ", ") - return s + return true } -func (this *AgentUpdatesResponse) GoString() string { - if this == nil { - return "nil" +func (this *ExecutionStats) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 8) - s = append(s, "&metadatapb.AgentUpdatesResponse{") - if this.AgentUpdates != nil { - s = append(s, "AgentUpdates: "+fmt.Sprintf("%#v", this.AgentUpdates)+",\n") + + that1, ok := that.(*ExecutionStats) + if !ok { + that2, ok := that.(ExecutionStats) + if ok { + that1 = &that2 + } else { + return false + } } - if this.AgentSchemas != nil { - s = append(s, "AgentSchemas: "+fmt.Sprintf("%#v", this.AgentSchemas)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "AgentSchemasUpdated: "+fmt.Sprintf("%#v", this.AgentSchemasUpdated)+",\n") - s = append(s, "EndOfVersion: "+fmt.Sprintf("%#v", this.EndOfVersion)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WithPrefixKeyRequest) GoString() string { - if this == nil { - return "nil" + if this.ExecutionTimeNs != that1.ExecutionTimeNs { + return false } - s := make([]string, 0, 6) - s = append(s, "&metadatapb.WithPrefixKeyRequest{") - s = append(s, "Prefix: "+fmt.Sprintf("%#v", this.Prefix)+",\n") - s = append(s, "Proto: "+fmt.Sprintf("%#v", this.Proto)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WithPrefixKeyResponse) GoString() string { - if this == nil { - return "nil" + if this.CompilationTimeNs != that1.CompilationTimeNs { + return false } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.WithPrefixKeyResponse{") - if this.Kvs != nil { - s = append(s, "Kvs: "+fmt.Sprintf("%#v", this.Kvs)+",\n") + if this.BytesProcessed != that1.BytesProcessed { + return false } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WithPrefixKeyResponse_KV) GoString() string { - if this == nil { - return "nil" + if this.RecordsProcessed != that1.RecordsProcessed { + return false } - s := make([]string, 0, 6) - s = append(s, "&metadatapb.WithPrefixKeyResponse_KV{") - s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *RegisterTracepointRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.RegisterTracepointRequest{") - if this.Requests != nil { - s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") +func (this *RecordExecutionResultRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RegisterTracepointRequest_TracepointRequest) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*RecordExecutionResultRequest) + if !ok { + that2, ok := that.(RecordExecutionResultRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 7) - s = append(s, "&metadatapb.RegisterTracepointRequest_TracepointRequest{") - if this.TracepointDeployment != nil { - s = append(s, "TracepointDeployment: "+fmt.Sprintf("%#v", this.TracepointDeployment)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - if this.TTL != nil { - s = append(s, "TTL: "+fmt.Sprintf("%#v", this.TTL)+",\n") + if !this.ScriptID.Equal(that1.ScriptID) { + return false } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RegisterTracepointResponse) GoString() string { - if this == nil { - return "nil" + if !this.Timestamp.Equal(that1.Timestamp) { + return false } - s := make([]string, 0, 6) - s = append(s, "&metadatapb.RegisterTracepointResponse{") - if this.Tracepoints != nil { - s = append(s, "Tracepoints: "+fmt.Sprintf("%#v", this.Tracepoints)+",\n") - } - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + if that1.Result == nil { + if this.Result != nil { + return false + } + } else if this.Result == nil { + return false + } else if !this.Result.Equal(that1.Result) { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *RegisterTracepointResponse_TracepointStatus) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&metadatapb.RegisterTracepointResponse_TracepointStatus{") - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") +func (this *RecordExecutionResultRequest_Error) Equal(that interface{}) bool { + if that == nil { + return this == nil } - if this.ID != nil { - s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + + that1, ok := that.(*RecordExecutionResultRequest_Error) + if !ok { + that2, ok := that.(RecordExecutionResultRequest_Error) + if ok { + that1 = &that2 + } else { + return false + } } - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetTracepointInfoRequest) GoString() string { - if this == nil { - return "nil" + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.GetTracepointInfoRequest{") - if this.IDs != nil { - s = append(s, "IDs: "+fmt.Sprintf("%#v", this.IDs)+",\n") + if !this.Error.Equal(that1.Error) { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *GetTracepointInfoResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.GetTracepointInfoResponse{") - if this.Tracepoints != nil { - s = append(s, "Tracepoints: "+fmt.Sprintf("%#v", this.Tracepoints)+",\n") +func (this *RecordExecutionResultRequest_ExecutionStats) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetTracepointInfoResponse_TracepointState) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*RecordExecutionResultRequest_ExecutionStats) + if !ok { + that2, ok := that.(RecordExecutionResultRequest_ExecutionStats) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 10) - s = append(s, "&metadatapb.GetTracepointInfoResponse_TracepointState{") - if this.ID != nil { - s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - if this.Statuses != nil { - s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") + if !this.ExecutionStats.Equal(that1.ExecutionStats) { + return false } - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "ExpectedState: "+fmt.Sprintf("%#v", this.ExpectedState)+",\n") - s = append(s, "SchemaNames: "+fmt.Sprintf("%#v", this.SchemaNames)+",\n") - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *RemoveTracepointRequest) GoString() string { - if this == nil { - return "nil" +func (this *RecordExecutionResultResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.RemoveTracepointRequest{") - s = append(s, "Names: "+fmt.Sprintf("%#v", this.Names)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RemoveTracepointResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*RecordExecutionResultResponse) + if !ok { + that2, ok := that.(RecordExecutionResultResponse) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.RemoveTracepointResponse{") - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *UpdateConfigRequest) GoString() string { - if this == nil { - return "nil" +func (this *GetAllExecutionResultsRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 7) - s = append(s, "&metadatapb.UpdateConfigRequest{") - s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "AgentPodName: "+fmt.Sprintf("%#v", this.AgentPodName)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpdateConfigResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*GetAllExecutionResultsRequest) + if !ok { + that2, ok := that.(GetAllExecutionResultsRequest) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.UpdateConfigResponse{") - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *GetScriptsRequest) GoString() string { - if this == nil { - return "nil" +func (this *GetAllExecutionResultsResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.GetScriptsRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetScriptsResponse) GoString() string { - if this == nil { - return "nil" + + that1, ok := that.(*GetAllExecutionResultsResponse) + if !ok { + that2, ok := that.(GetAllExecutionResultsResponse) + if ok { + that1 = &that2 + } else { + return false + } } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.GetScriptsResponse{") - keysForScripts := make([]string, 0, len(this.Scripts)) - for k, _ := range this.Scripts { - keysForScripts = append(keysForScripts, k) + if that1 == nil { + return this == nil + } else if this == nil { + return false } - github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) - mapStringForScripts := "map[string]*cvmsgspb.CronScript{" - for _, k := range keysForScripts { - mapStringForScripts += fmt.Sprintf("%#v: %#v,", k, this.Scripts[k]) + if len(this.Results) != len(that1.Results) { + return false } - mapStringForScripts += "}" - if this.Scripts != nil { - s = append(s, "Scripts: "+mapStringForScripts+",\n") + for i := range this.Results { + if !this.Results[i].Equal(that1.Results[i]) { + return false + } } - s = append(s, "}") - return strings.Join(s, "") + return true } -func (this *AddOrUpdateScriptRequest) GoString() string { - if this == nil { - return "nil" +func (this *GetAllExecutionResultsResponse_ExecutionResult) Equal(that interface{}) bool { + if that == nil { + return this == nil } - s := make([]string, 0, 5) - s = append(s, "&metadatapb.AddOrUpdateScriptRequest{") - if this.Script != nil { - s = append(s, "Script: "+fmt.Sprintf("%#v", this.Script)+",\n") + + that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult) + if !ok { + that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult) + if ok { + that1 = &that2 + } else { + return false + } } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AddOrUpdateScriptResponse) GoString() string { - if this == nil { - return "nil" + if that1 == nil { + return this == nil + } else if this == nil { + return false } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.AddOrUpdateScriptResponse{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DeleteScriptRequest) GoString() string { + if !this.ScriptID.Equal(that1.ScriptID) { + return false + } + if !this.Timestamp.Equal(that1.Timestamp) { + return false + } + if that1.Result == nil { + if this.Result != nil { + return false + } + } else if this.Result == nil { + return false + } else if !this.Result.Equal(that1.Result) { + return false + } + return true +} +func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult_Error) + if !ok { + that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult_Error) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Error.Equal(that1.Error) { + return false + } + return true +} +func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) + if !ok { + that2, ok := that.(GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ExecutionStats.Equal(that1.ExecutionStats) { + return false + } + return true +} +func (this *SchemaRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&metadatapb.SchemaRequest{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *SchemaResponse) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) - s = append(s, "&metadatapb.DeleteScriptRequest{") - if this.ScriptID != nil { - s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") + s = append(s, "&metadatapb.SchemaResponse{") + if this.Schema != nil { + s = append(s, "Schema: "+fmt.Sprintf("%#v", this.Schema)+",\n") } s = append(s, "}") return strings.Join(s, "") } -func (this *DeleteScriptResponse) GoString() string { +func (this *AgentInfoRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 4) - s = append(s, "&metadatapb.DeleteScriptResponse{") + s = append(s, "&metadatapb.AgentInfoRequest{") s = append(s, "}") return strings.Join(s, "") } -func (this *SetScriptsRequest) GoString() string { +func (this *AgentInfoResponse) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) - s = append(s, "&metadatapb.SetScriptsRequest{") - keysForScripts := make([]string, 0, len(this.Scripts)) - for k, _ := range this.Scripts { - keysForScripts = append(keysForScripts, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) - mapStringForScripts := "map[string]*cvmsgspb.CronScript{" - for _, k := range keysForScripts { - mapStringForScripts += fmt.Sprintf("%#v: %#v,", k, this.Scripts[k]) - } - mapStringForScripts += "}" - if this.Scripts != nil { - s = append(s, "Scripts: "+mapStringForScripts+",\n") + s = append(s, "&metadatapb.AgentInfoResponse{") + if this.Info != nil { + s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n") } s = append(s, "}") return strings.Join(s, "") } -func (this *SetScriptsResponse) GoString() string { +func (this *AgentMetadata) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.SetScriptsResponse{") + s := make([]string, 0, 7) + s = append(s, "&metadatapb.AgentMetadata{") + if this.Agent != nil { + s = append(s, "Agent: "+fmt.Sprintf("%#v", this.Agent)+",\n") + } + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + if this.CarnotInfo != nil { + s = append(s, "CarnotInfo: "+fmt.Sprintf("%#v", this.CarnotInfo)+",\n") + } s = append(s, "}") return strings.Join(s, "") } -func (this *ExecutionStats) GoString() string { +func (this *AgentUpdatesRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) - s = append(s, "&metadatapb.ExecutionStats{") - s = append(s, "ExecutionTimeNs: "+fmt.Sprintf("%#v", this.ExecutionTimeNs)+",\n") - s = append(s, "CompilationTimeNs: "+fmt.Sprintf("%#v", this.CompilationTimeNs)+",\n") - s = append(s, "BytesProcessed: "+fmt.Sprintf("%#v", this.BytesProcessed)+",\n") - s = append(s, "RecordsProcessed: "+fmt.Sprintf("%#v", this.RecordsProcessed)+",\n") + s := make([]string, 0, 6) + s = append(s, "&metadatapb.AgentUpdatesRequest{") + if this.MaxUpdateInterval != nil { + s = append(s, "MaxUpdateInterval: "+fmt.Sprintf("%#v", this.MaxUpdateInterval)+",\n") + } + s = append(s, "MaxUpdatesPerResponse: "+fmt.Sprintf("%#v", this.MaxUpdatesPerResponse)+",\n") s = append(s, "}") return strings.Join(s, "") } -func (this *RecordExecutionResultRequest) GoString() string { +func (this *AgentUpdate) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) - s = append(s, "&metadatapb.RecordExecutionResultRequest{") - if this.ScriptID != nil { - s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") - } - if this.Timestamp != nil { - s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") + s = append(s, "&metadatapb.AgentUpdate{") + if this.AgentID != nil { + s = append(s, "AgentID: "+fmt.Sprintf("%#v", this.AgentID)+",\n") } - if this.Result != nil { - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") + if this.Update != nil { + s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") } s = append(s, "}") return strings.Join(s, "") } -func (this *RecordExecutionResultRequest_Error) GoString() string { +func (this *AgentUpdate_Deleted) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&metadatapb.RecordExecutionResultRequest_Error{` + - `Error:` + fmt.Sprintf("%#v", this.Error) + `}`}, ", ") + s := strings.Join([]string{`&metadatapb.AgentUpdate_Deleted{` + + `Deleted:` + fmt.Sprintf("%#v", this.Deleted) + `}`}, ", ") return s } -func (this *RecordExecutionResultRequest_ExecutionStats) GoString() string { +func (this *AgentUpdate_Agent) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&metadatapb.RecordExecutionResultRequest_ExecutionStats{` + - `ExecutionStats:` + fmt.Sprintf("%#v", this.ExecutionStats) + `}`}, ", ") + s := strings.Join([]string{`&metadatapb.AgentUpdate_Agent{` + + `Agent:` + fmt.Sprintf("%#v", this.Agent) + `}`}, ", ") return s } -func (this *RecordExecutionResultResponse) GoString() string { +func (this *AgentUpdate_DataInfo) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.RecordExecutionResultResponse{") + s := strings.Join([]string{`&metadatapb.AgentUpdate_DataInfo{` + + `DataInfo:` + fmt.Sprintf("%#v", this.DataInfo) + `}`}, ", ") + return s +} +func (this *AgentUpdatesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&metadatapb.AgentUpdatesResponse{") + if this.AgentUpdates != nil { + s = append(s, "AgentUpdates: "+fmt.Sprintf("%#v", this.AgentUpdates)+",\n") + } + if this.AgentSchemas != nil { + s = append(s, "AgentSchemas: "+fmt.Sprintf("%#v", this.AgentSchemas)+",\n") + } + s = append(s, "AgentSchemasUpdated: "+fmt.Sprintf("%#v", this.AgentSchemasUpdated)+",\n") + s = append(s, "EndOfVersion: "+fmt.Sprintf("%#v", this.EndOfVersion)+",\n") s = append(s, "}") return strings.Join(s, "") } -func (this *GetAllExecutionResultsRequest) GoString() string { +func (this *WithPrefixKeyRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 4) - s = append(s, "&metadatapb.GetAllExecutionResultsRequest{") + s := make([]string, 0, 6) + s = append(s, "&metadatapb.WithPrefixKeyRequest{") + s = append(s, "Prefix: "+fmt.Sprintf("%#v", this.Prefix)+",\n") + s = append(s, "Proto: "+fmt.Sprintf("%#v", this.Proto)+",\n") s = append(s, "}") return strings.Join(s, "") } -func (this *GetAllExecutionResultsResponse) GoString() string { +func (this *WithPrefixKeyResponse) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) - s = append(s, "&metadatapb.GetAllExecutionResultsResponse{") - if this.Results != nil { - s = append(s, "Results: "+fmt.Sprintf("%#v", this.Results)+",\n") + s = append(s, "&metadatapb.WithPrefixKeyResponse{") + if this.Kvs != nil { + s = append(s, "Kvs: "+fmt.Sprintf("%#v", this.Kvs)+",\n") } s = append(s, "}") return strings.Join(s, "") } -func (this *GetAllExecutionResultsResponse_ExecutionResult) GoString() string { +func (this *WithPrefixKeyResponse_KV) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) - s = append(s, "&metadatapb.GetAllExecutionResultsResponse_ExecutionResult{") - if this.ScriptID != nil { - s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") - } - if this.Timestamp != nil { - s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") + s := make([]string, 0, 6) + s = append(s, "&metadatapb.WithPrefixKeyResponse_KV{") + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RegisterFileSourceRequest) GoString() string { + if this == nil { + return "nil" } - if this.Result != nil { - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RegisterFileSourceRequest{") + if this.Requests != nil { + s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") } s = append(s, "}") return strings.Join(s, "") } -func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) GoString() string { +func (this *RegisterFileSourceResponse) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&metadatapb.GetAllExecutionResultsResponse_ExecutionResult_Error{` + - `Error:` + fmt.Sprintf("%#v", this.Error) + `}`}, ", ") - return s + s := make([]string, 0, 6) + s = append(s, "&metadatapb.RegisterFileSourceResponse{") + if this.FileSources != nil { + s = append(s, "FileSources: "+fmt.Sprintf("%#v", this.FileSources)+",\n") + } + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) GoString() string { +func (this *RegisterFileSourceResponse_FileSourceStatus) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&metadatapb.GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats{` + - `ExecutionStats:` + fmt.Sprintf("%#v", this.ExecutionStats) + `}`}, ", ") - return s + s := make([]string, 0, 7) + s = append(s, "&metadatapb.RegisterFileSourceResponse_FileSourceStatus{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "}") + return strings.Join(s, "") } -func valueToGoStringService(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { +func (this *GetFileSourceInfoRequest) GoString() string { + if this == nil { return "nil" } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MetadataServiceClient is the client API for MetadataService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetadataServiceClient interface { - GetAgentUpdates(ctx context.Context, in *AgentUpdatesRequest, opts ...grpc.CallOption) (MetadataService_GetAgentUpdatesClient, error) - GetSchemas(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) - GetAgentInfo(ctx context.Context, in *AgentInfoRequest, opts ...grpc.CallOption) (*AgentInfoResponse, error) - GetWithPrefixKey(ctx context.Context, in *WithPrefixKeyRequest, opts ...grpc.CallOption) (*WithPrefixKeyResponse, error) -} - -type metadataServiceClient struct { - cc *grpc.ClientConn + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetFileSourceInfoRequest{") + if this.IDs != nil { + s = append(s, "IDs: "+fmt.Sprintf("%#v", this.IDs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewMetadataServiceClient(cc *grpc.ClientConn) MetadataServiceClient { - return &metadataServiceClient{cc} +func (this *GetFileSourceInfoResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetFileSourceInfoResponse{") + if this.FileSources != nil { + s = append(s, "FileSources: "+fmt.Sprintf("%#v", this.FileSources)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (c *metadataServiceClient) GetAgentUpdates(ctx context.Context, in *AgentUpdatesRequest, opts ...grpc.CallOption) (MetadataService_GetAgentUpdatesClient, error) { - stream, err := c.cc.NewStream(ctx, &_MetadataService_serviceDesc.Streams[0], "/px.vizier.services.metadata.MetadataService/GetAgentUpdates", opts...) - if err != nil { - return nil, err +func (this *GetFileSourceInfoResponse_FileSourceState) GoString() string { + if this == nil { + return "nil" } - x := &metadataServiceGetAgentUpdatesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err + s := make([]string, 0, 10) + s = append(s, "&metadatapb.GetFileSourceInfoResponse_FileSourceState{") + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + if this.Statuses != nil { + s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") } - return x, nil -} - -type MetadataService_GetAgentUpdatesClient interface { - Recv() (*AgentUpdatesResponse, error) - grpc.ClientStream -} - -type metadataServiceGetAgentUpdatesClient struct { - grpc.ClientStream + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "ExpectedState: "+fmt.Sprintf("%#v", this.ExpectedState)+",\n") + s = append(s, "SchemaNames: "+fmt.Sprintf("%#v", this.SchemaNames)+",\n") + s = append(s, "}") + return strings.Join(s, "") } - -func (x *metadataServiceGetAgentUpdatesClient) Recv() (*AgentUpdatesResponse, error) { - m := new(AgentUpdatesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (this *RemoveFileSourceRequest) GoString() string { + if this == nil { + return "nil" } - return m, nil + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RemoveFileSourceRequest{") + s = append(s, "Names: "+fmt.Sprintf("%#v", this.Names)+",\n") + s = append(s, "}") + return strings.Join(s, "") } - -func (c *metadataServiceClient) GetSchemas(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) { - out := new(SchemaResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetSchemas", in, out, opts...) - if err != nil { - return nil, err +func (this *RemoveFileSourceResponse) GoString() string { + if this == nil { + return "nil" } - return out, nil -} - -func (c *metadataServiceClient) GetAgentInfo(ctx context.Context, in *AgentInfoRequest, opts ...grpc.CallOption) (*AgentInfoResponse, error) { - out := new(AgentInfoResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetAgentInfo", in, out, opts...) - if err != nil { - return nil, err + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RemoveFileSourceResponse{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") } - return out, nil + s = append(s, "}") + return strings.Join(s, "") } - -func (c *metadataServiceClient) GetWithPrefixKey(ctx context.Context, in *WithPrefixKeyRequest, opts ...grpc.CallOption) (*WithPrefixKeyResponse, error) { - out := new(WithPrefixKeyResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetWithPrefixKey", in, out, opts...) - if err != nil { - return nil, err +func (this *RegisterTracepointRequest) GoString() string { + if this == nil { + return "nil" } - return out, nil -} - -// MetadataServiceServer is the server API for MetadataService service. -type MetadataServiceServer interface { - GetAgentUpdates(*AgentUpdatesRequest, MetadataService_GetAgentUpdatesServer) error - GetSchemas(context.Context, *SchemaRequest) (*SchemaResponse, error) - GetAgentInfo(context.Context, *AgentInfoRequest) (*AgentInfoResponse, error) - GetWithPrefixKey(context.Context, *WithPrefixKeyRequest) (*WithPrefixKeyResponse, error) -} - -// UnimplementedMetadataServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetadataServiceServer struct { -} - -func (*UnimplementedMetadataServiceServer) GetAgentUpdates(req *AgentUpdatesRequest, srv MetadataService_GetAgentUpdatesServer) error { - return status.Errorf(codes.Unimplemented, "method GetAgentUpdates not implemented") -} -func (*UnimplementedMetadataServiceServer) GetSchemas(ctx context.Context, req *SchemaRequest) (*SchemaResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSchemas not implemented") -} -func (*UnimplementedMetadataServiceServer) GetAgentInfo(ctx context.Context, req *AgentInfoRequest) (*AgentInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAgentInfo not implemented") -} -func (*UnimplementedMetadataServiceServer) GetWithPrefixKey(ctx context.Context, req *WithPrefixKeyRequest) (*WithPrefixKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetWithPrefixKey not implemented") -} - -func RegisterMetadataServiceServer(s *grpc.Server, srv MetadataServiceServer) { - s.RegisterService(&_MetadataService_serviceDesc, srv) -} - -func _MetadataService_GetAgentUpdates_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AgentUpdatesRequest) - if err := stream.RecvMsg(m); err != nil { - return err + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RegisterTracepointRequest{") + if this.Requests != nil { + s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") } - return srv.(MetadataServiceServer).GetAgentUpdates(m, &metadataServiceGetAgentUpdatesServer{stream}) -} - -type MetadataService_GetAgentUpdatesServer interface { - Send(*AgentUpdatesResponse) error - grpc.ServerStream -} - -type metadataServiceGetAgentUpdatesServer struct { - grpc.ServerStream -} - -func (x *metadataServiceGetAgentUpdatesServer) Send(m *AgentUpdatesResponse) error { - return x.ServerStream.SendMsg(m) + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataService_GetSchemas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SchemaRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetadataServiceServer).GetSchemas(ctx, in) +func (this *RegisterTracepointRequest_TracepointRequest) GoString() string { + if this == nil { + return "nil" } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataService/GetSchemas", + s := make([]string, 0, 7) + s = append(s, "&metadatapb.RegisterTracepointRequest_TracepointRequest{") + if this.TracepointDeployment != nil { + s = append(s, "TracepointDeployment: "+fmt.Sprintf("%#v", this.TracepointDeployment)+",\n") } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataServiceServer).GetSchemas(ctx, req.(*SchemaRequest)) + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + if this.TTL != nil { + s = append(s, "TTL: "+fmt.Sprintf("%#v", this.TTL)+",\n") } - return interceptor(ctx, in, info, handler) + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataService_GetAgentInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AgentInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetadataServiceServer).GetAgentInfo(ctx, in) +func (this *RegisterTracepointResponse) GoString() string { + if this == nil { + return "nil" } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataService/GetAgentInfo", + s := make([]string, 0, 6) + s = append(s, "&metadatapb.RegisterTracepointResponse{") + if this.Tracepoints != nil { + s = append(s, "Tracepoints: "+fmt.Sprintf("%#v", this.Tracepoints)+",\n") } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataServiceServer).GetAgentInfo(ctx, req.(*AgentInfoRequest)) + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") } - return interceptor(ctx, in, info, handler) + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataService_GetWithPrefixKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WithPrefixKeyRequest) - if err := dec(in); err != nil { - return nil, err +func (this *RegisterTracepointResponse_TracepointStatus) GoString() string { + if this == nil { + return "nil" } - if interceptor == nil { - return srv.(MetadataServiceServer).GetWithPrefixKey(ctx, in) + s := make([]string, 0, 7) + s = append(s, "&metadatapb.RegisterTracepointResponse_TracepointStatus{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataService/GetWithPrefixKey", + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataServiceServer).GetWithPrefixKey(ctx, req.(*WithPrefixKeyRequest)) + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetTracepointInfoRequest) GoString() string { + if this == nil { + return "nil" } - return interceptor(ctx, in, info, handler) + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetTracepointInfoRequest{") + if this.IDs != nil { + s = append(s, "IDs: "+fmt.Sprintf("%#v", this.IDs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -var _MetadataService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "px.vizier.services.metadata.MetadataService", - HandlerType: (*MetadataServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetSchemas", - Handler: _MetadataService_GetSchemas_Handler, - }, - { - MethodName: "GetAgentInfo", - Handler: _MetadataService_GetAgentInfo_Handler, - }, - { - MethodName: "GetWithPrefixKey", - Handler: _MetadataService_GetWithPrefixKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetAgentUpdates", - Handler: _MetadataService_GetAgentUpdates_Handler, - ServerStreams: true, - }, - }, - Metadata: "src/vizier/services/metadata/metadatapb/service.proto", -} - -// MetadataTracepointServiceClient is the client API for MetadataTracepointService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetadataTracepointServiceClient interface { - RegisterTracepoint(ctx context.Context, in *RegisterTracepointRequest, opts ...grpc.CallOption) (*RegisterTracepointResponse, error) - GetTracepointInfo(ctx context.Context, in *GetTracepointInfoRequest, opts ...grpc.CallOption) (*GetTracepointInfoResponse, error) - RemoveTracepoint(ctx context.Context, in *RemoveTracepointRequest, opts ...grpc.CallOption) (*RemoveTracepointResponse, error) -} - -type metadataTracepointServiceClient struct { - cc *grpc.ClientConn -} - -func NewMetadataTracepointServiceClient(cc *grpc.ClientConn) MetadataTracepointServiceClient { - return &metadataTracepointServiceClient{cc} -} - -func (c *metadataTracepointServiceClient) RegisterTracepoint(ctx context.Context, in *RegisterTracepointRequest, opts ...grpc.CallOption) (*RegisterTracepointResponse, error) { - out := new(RegisterTracepointResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/RegisterTracepoint", in, out, opts...) - if err != nil { - return nil, err +func (this *GetTracepointInfoResponse) GoString() string { + if this == nil { + return "nil" } - return out, nil -} - -func (c *metadataTracepointServiceClient) GetTracepointInfo(ctx context.Context, in *GetTracepointInfoRequest, opts ...grpc.CallOption) (*GetTracepointInfoResponse, error) { - out := new(GetTracepointInfoResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/GetTracepointInfo", in, out, opts...) - if err != nil { - return nil, err + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetTracepointInfoResponse{") + if this.Tracepoints != nil { + s = append(s, "Tracepoints: "+fmt.Sprintf("%#v", this.Tracepoints)+",\n") } - return out, nil + s = append(s, "}") + return strings.Join(s, "") } - -func (c *metadataTracepointServiceClient) RemoveTracepoint(ctx context.Context, in *RemoveTracepointRequest, opts ...grpc.CallOption) (*RemoveTracepointResponse, error) { - out := new(RemoveTracepointResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/RemoveTracepoint", in, out, opts...) - if err != nil { - return nil, err +func (this *GetTracepointInfoResponse_TracepointState) GoString() string { + if this == nil { + return "nil" } - return out, nil -} - -// MetadataTracepointServiceServer is the server API for MetadataTracepointService service. -type MetadataTracepointServiceServer interface { - RegisterTracepoint(context.Context, *RegisterTracepointRequest) (*RegisterTracepointResponse, error) - GetTracepointInfo(context.Context, *GetTracepointInfoRequest) (*GetTracepointInfoResponse, error) - RemoveTracepoint(context.Context, *RemoveTracepointRequest) (*RemoveTracepointResponse, error) + s := make([]string, 0, 10) + s = append(s, "&metadatapb.GetTracepointInfoResponse_TracepointState{") + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + if this.Statuses != nil { + s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") + } + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "ExpectedState: "+fmt.Sprintf("%#v", this.ExpectedState)+",\n") + s = append(s, "SchemaNames: "+fmt.Sprintf("%#v", this.SchemaNames)+",\n") + s = append(s, "}") + return strings.Join(s, "") } - -// UnimplementedMetadataTracepointServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetadataTracepointServiceServer struct { +func (this *RemoveTracepointRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RemoveTracepointRequest{") + s = append(s, "Names: "+fmt.Sprintf("%#v", this.Names)+",\n") + s = append(s, "}") + return strings.Join(s, "") } - -func (*UnimplementedMetadataTracepointServiceServer) RegisterTracepoint(ctx context.Context, req *RegisterTracepointRequest) (*RegisterTracepointResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterTracepoint not implemented") +func (this *RemoveTracepointResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.RemoveTracepointResponse{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (*UnimplementedMetadataTracepointServiceServer) GetTracepointInfo(ctx context.Context, req *GetTracepointInfoRequest) (*GetTracepointInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTracepointInfo not implemented") +func (this *UpdateConfigRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&metadatapb.UpdateConfigRequest{") + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "AgentPodName: "+fmt.Sprintf("%#v", this.AgentPodName)+",\n") + s = append(s, "}") + return strings.Join(s, "") } -func (*UnimplementedMetadataTracepointServiceServer) RemoveTracepoint(ctx context.Context, req *RemoveTracepointRequest) (*RemoveTracepointResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveTracepoint not implemented") +func (this *UpdateConfigResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.UpdateConfigResponse{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func RegisterMetadataTracepointServiceServer(s *grpc.Server, srv MetadataTracepointServiceServer) { - s.RegisterService(&_MetadataTracepointService_serviceDesc, srv) +func (this *GetScriptsRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&metadatapb.GetScriptsRequest{") + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataTracepointService_RegisterTracepoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterTracepointRequest) - if err := dec(in); err != nil { - return nil, err +func (this *GetScriptsResponse) GoString() string { + if this == nil { + return "nil" } - if interceptor == nil { - return srv.(MetadataTracepointServiceServer).RegisterTracepoint(ctx, in) + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetScriptsResponse{") + keysForScripts := make([]string, 0, len(this.Scripts)) + for k, _ := range this.Scripts { + keysForScripts = append(keysForScripts, k) } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/RegisterTracepoint", + github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) + mapStringForScripts := "map[string]*cvmsgspb.CronScript{" + for _, k := range keysForScripts { + mapStringForScripts += fmt.Sprintf("%#v: %#v,", k, this.Scripts[k]) } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataTracepointServiceServer).RegisterTracepoint(ctx, req.(*RegisterTracepointRequest)) + mapStringForScripts += "}" + if this.Scripts != nil { + s = append(s, "Scripts: "+mapStringForScripts+",\n") } - return interceptor(ctx, in, info, handler) + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataTracepointService_GetTracepointInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTracepointInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetadataTracepointServiceServer).GetTracepointInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/GetTracepointInfo", +func (this *AddOrUpdateScriptRequest) GoString() string { + if this == nil { + return "nil" } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataTracepointServiceServer).GetTracepointInfo(ctx, req.(*GetTracepointInfoRequest)) + s := make([]string, 0, 5) + s = append(s, "&metadatapb.AddOrUpdateScriptRequest{") + if this.Script != nil { + s = append(s, "Script: "+fmt.Sprintf("%#v", this.Script)+",\n") } - return interceptor(ctx, in, info, handler) + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataTracepointService_RemoveTracepoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveTracepointRequest) - if err := dec(in); err != nil { - return nil, err +func (this *AddOrUpdateScriptResponse) GoString() string { + if this == nil { + return "nil" } - if interceptor == nil { - return srv.(MetadataTracepointServiceServer).RemoveTracepoint(ctx, in) + s := make([]string, 0, 4) + s = append(s, "&metadatapb.AddOrUpdateScriptResponse{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DeleteScriptRequest) GoString() string { + if this == nil { + return "nil" } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/RemoveTracepoint", + s := make([]string, 0, 5) + s = append(s, "&metadatapb.DeleteScriptRequest{") + if this.ScriptID != nil { + s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataTracepointServiceServer).RemoveTracepoint(ctx, req.(*RemoveTracepointRequest)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DeleteScriptResponse) GoString() string { + if this == nil { + return "nil" } - return interceptor(ctx, in, info, handler) + s := make([]string, 0, 4) + s = append(s, "&metadatapb.DeleteScriptResponse{") + s = append(s, "}") + return strings.Join(s, "") } - -var _MetadataTracepointService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "px.vizier.services.metadata.MetadataTracepointService", - HandlerType: (*MetadataTracepointServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterTracepoint", - Handler: _MetadataTracepointService_RegisterTracepoint_Handler, - }, - { - MethodName: "GetTracepointInfo", - Handler: _MetadataTracepointService_GetTracepointInfo_Handler, - }, - { - MethodName: "RemoveTracepoint", - Handler: _MetadataTracepointService_RemoveTracepoint_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "src/vizier/services/metadata/metadatapb/service.proto", +func (this *SetScriptsRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.SetScriptsRequest{") + keysForScripts := make([]string, 0, len(this.Scripts)) + for k, _ := range this.Scripts { + keysForScripts = append(keysForScripts, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) + mapStringForScripts := "map[string]*cvmsgspb.CronScript{" + for _, k := range keysForScripts { + mapStringForScripts += fmt.Sprintf("%#v: %#v,", k, this.Scripts[k]) + } + mapStringForScripts += "}" + if this.Scripts != nil { + s = append(s, "Scripts: "+mapStringForScripts+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -// MetadataConfigServiceClient is the client API for MetadataConfigService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetadataConfigServiceClient interface { - UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) +func (this *SetScriptsResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&metadatapb.SetScriptsResponse{") + s = append(s, "}") + return strings.Join(s, "") } - -type metadataConfigServiceClient struct { - cc *grpc.ClientConn +func (this *ExecutionStats) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&metadatapb.ExecutionStats{") + s = append(s, "ExecutionTimeNs: "+fmt.Sprintf("%#v", this.ExecutionTimeNs)+",\n") + s = append(s, "CompilationTimeNs: "+fmt.Sprintf("%#v", this.CompilationTimeNs)+",\n") + s = append(s, "BytesProcessed: "+fmt.Sprintf("%#v", this.BytesProcessed)+",\n") + s = append(s, "RecordsProcessed: "+fmt.Sprintf("%#v", this.RecordsProcessed)+",\n") + s = append(s, "}") + return strings.Join(s, "") } - -func NewMetadataConfigServiceClient(cc *grpc.ClientConn) MetadataConfigServiceClient { - return &metadataConfigServiceClient{cc} +func (this *RecordExecutionResultRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&metadatapb.RecordExecutionResultRequest{") + if this.ScriptID != nil { + s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") + } + if this.Timestamp != nil { + s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") + } + if this.Result != nil { + s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (c *metadataConfigServiceClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) { - out := new(UpdateConfigResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataConfigService/UpdateConfig", in, out, opts...) - if err != nil { - return nil, err +func (this *RecordExecutionResultRequest_Error) GoString() string { + if this == nil { + return "nil" } - return out, nil + s := strings.Join([]string{`&metadatapb.RecordExecutionResultRequest_Error{` + + `Error:` + fmt.Sprintf("%#v", this.Error) + `}`}, ", ") + return s } - -// MetadataConfigServiceServer is the server API for MetadataConfigService service. -type MetadataConfigServiceServer interface { - UpdateConfig(context.Context, *UpdateConfigRequest) (*UpdateConfigResponse, error) +func (this *RecordExecutionResultRequest_ExecutionStats) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&metadatapb.RecordExecutionResultRequest_ExecutionStats{` + + `ExecutionStats:` + fmt.Sprintf("%#v", this.ExecutionStats) + `}`}, ", ") + return s } - -// UnimplementedMetadataConfigServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetadataConfigServiceServer struct { +func (this *RecordExecutionResultResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&metadatapb.RecordExecutionResultResponse{") + s = append(s, "}") + return strings.Join(s, "") } - -func (*UnimplementedMetadataConfigServiceServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*UpdateConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") +func (this *GetAllExecutionResultsRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&metadatapb.GetAllExecutionResultsRequest{") + s = append(s, "}") + return strings.Join(s, "") } - -func RegisterMetadataConfigServiceServer(s *grpc.Server, srv MetadataConfigServiceServer) { - s.RegisterService(&_MetadataConfigService_serviceDesc, srv) +func (this *GetAllExecutionResultsResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&metadatapb.GetAllExecutionResultsResponse{") + if this.Results != nil { + s = append(s, "Results: "+fmt.Sprintf("%#v", this.Results)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func _MetadataConfigService_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateConfigRequest) - if err := dec(in); err != nil { - return nil, err +func (this *GetAllExecutionResultsResponse_ExecutionResult) GoString() string { + if this == nil { + return "nil" } - if interceptor == nil { - return srv.(MetadataConfigServiceServer).UpdateConfig(ctx, in) + s := make([]string, 0, 8) + s = append(s, "&metadatapb.GetAllExecutionResultsResponse_ExecutionResult{") + if this.ScriptID != nil { + s = append(s, "ScriptID: "+fmt.Sprintf("%#v", this.ScriptID)+",\n") } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/px.vizier.services.metadata.MetadataConfigService/UpdateConfig", + if this.Timestamp != nil { + s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetadataConfigServiceServer).UpdateConfig(ctx, req.(*UpdateConfigRequest)) + if this.Result != nil { + s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") } - return interceptor(ctx, in, info, handler) + s = append(s, "}") + return strings.Join(s, "") } - -var _MetadataConfigService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "px.vizier.services.metadata.MetadataConfigService", - HandlerType: (*MetadataConfigServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateConfig", - Handler: _MetadataConfigService_UpdateConfig_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "src/vizier/services/metadata/metadatapb/service.proto", +func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&metadatapb.GetAllExecutionResultsResponse_ExecutionResult_Error{` + + `Error:` + fmt.Sprintf("%#v", this.Error) + `}`}, ", ") + return s +} +func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&metadatapb.GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats{` + + `ExecutionStats:` + fmt.Sprintf("%#v", this.ExecutionStats) + `}`}, ", ") + return s +} +func valueToGoStringService(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } -// CronScriptStoreServiceClient is the client API for CronScriptStoreService service. +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MetadataServiceClient is the client API for MetadataService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type CronScriptStoreServiceClient interface { - GetScripts(ctx context.Context, in *GetScriptsRequest, opts ...grpc.CallOption) (*GetScriptsResponse, error) - AddOrUpdateScript(ctx context.Context, in *AddOrUpdateScriptRequest, opts ...grpc.CallOption) (*AddOrUpdateScriptResponse, error) - DeleteScript(ctx context.Context, in *DeleteScriptRequest, opts ...grpc.CallOption) (*DeleteScriptResponse, error) - SetScripts(ctx context.Context, in *SetScriptsRequest, opts ...grpc.CallOption) (*SetScriptsResponse, error) - RecordExecutionResult(ctx context.Context, in *RecordExecutionResultRequest, opts ...grpc.CallOption) (*RecordExecutionResultResponse, error) - GetAllExecutionResults(ctx context.Context, in *GetAllExecutionResultsRequest, opts ...grpc.CallOption) (*GetAllExecutionResultsResponse, error) +type MetadataServiceClient interface { + GetAgentUpdates(ctx context.Context, in *AgentUpdatesRequest, opts ...grpc.CallOption) (MetadataService_GetAgentUpdatesClient, error) + GetSchemas(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) + GetAgentInfo(ctx context.Context, in *AgentInfoRequest, opts ...grpc.CallOption) (*AgentInfoResponse, error) + GetWithPrefixKey(ctx context.Context, in *WithPrefixKeyRequest, opts ...grpc.CallOption) (*WithPrefixKeyResponse, error) } -type cronScriptStoreServiceClient struct { +type metadataServiceClient struct { cc *grpc.ClientConn } -func NewCronScriptStoreServiceClient(cc *grpc.ClientConn) CronScriptStoreServiceClient { - return &cronScriptStoreServiceClient{cc} +func NewMetadataServiceClient(cc *grpc.ClientConn) MetadataServiceClient { + return &metadataServiceClient{cc} } -func (c *cronScriptStoreServiceClient) GetScripts(ctx context.Context, in *GetScriptsRequest, opts ...grpc.CallOption) (*GetScriptsResponse, error) { - out := new(GetScriptsResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/GetScripts", in, out, opts...) +func (c *metadataServiceClient) GetAgentUpdates(ctx context.Context, in *AgentUpdatesRequest, opts ...grpc.CallOption) (MetadataService_GetAgentUpdatesClient, error) { + stream, err := c.cc.NewStream(ctx, &_MetadataService_serviceDesc.Streams[0], "/px.vizier.services.metadata.MetadataService/GetAgentUpdates", opts...) if err != nil { return nil, err } - return out, nil -} - -func (c *cronScriptStoreServiceClient) AddOrUpdateScript(ctx context.Context, in *AddOrUpdateScriptRequest, opts ...grpc.CallOption) (*AddOrUpdateScriptResponse, error) { - out := new(AddOrUpdateScriptResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/AddOrUpdateScript", in, out, opts...) - if err != nil { + x := &metadataServiceGetAgentUpdatesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } - return out, nil -} - -func (c *cronScriptStoreServiceClient) DeleteScript(ctx context.Context, in *DeleteScriptRequest, opts ...grpc.CallOption) (*DeleteScriptResponse, error) { - out := new(DeleteScriptResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/DeleteScript", in, out, opts...) - if err != nil { + if err := x.ClientStream.CloseSend(); err != nil { return nil, err } - return out, nil + return x, nil } -func (c *cronScriptStoreServiceClient) SetScripts(ctx context.Context, in *SetScriptsRequest, opts ...grpc.CallOption) (*SetScriptsResponse, error) { - out := new(SetScriptsResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/SetScripts", in, out, opts...) +type MetadataService_GetAgentUpdatesClient interface { + Recv() (*AgentUpdatesResponse, error) + grpc.ClientStream +} + +type metadataServiceGetAgentUpdatesClient struct { + grpc.ClientStream +} + +func (x *metadataServiceGetAgentUpdatesClient) Recv() (*AgentUpdatesResponse, error) { + m := new(AgentUpdatesResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *metadataServiceClient) GetSchemas(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) { + out := new(SchemaResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetSchemas", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *cronScriptStoreServiceClient) RecordExecutionResult(ctx context.Context, in *RecordExecutionResultRequest, opts ...grpc.CallOption) (*RecordExecutionResultResponse, error) { - out := new(RecordExecutionResultResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/RecordExecutionResult", in, out, opts...) +func (c *metadataServiceClient) GetAgentInfo(ctx context.Context, in *AgentInfoRequest, opts ...grpc.CallOption) (*AgentInfoResponse, error) { + out := new(AgentInfoResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetAgentInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *cronScriptStoreServiceClient) GetAllExecutionResults(ctx context.Context, in *GetAllExecutionResultsRequest, opts ...grpc.CallOption) (*GetAllExecutionResultsResponse, error) { - out := new(GetAllExecutionResultsResponse) - err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/GetAllExecutionResults", in, out, opts...) +func (c *metadataServiceClient) GetWithPrefixKey(ctx context.Context, in *WithPrefixKeyRequest, opts ...grpc.CallOption) (*WithPrefixKeyResponse, error) { + out := new(WithPrefixKeyResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataService/GetWithPrefixKey", in, out, opts...) if err != nil { return nil, err } return out, nil } -// CronScriptStoreServiceServer is the server API for CronScriptStoreService service. -type CronScriptStoreServiceServer interface { - GetScripts(context.Context, *GetScriptsRequest) (*GetScriptsResponse, error) - AddOrUpdateScript(context.Context, *AddOrUpdateScriptRequest) (*AddOrUpdateScriptResponse, error) - DeleteScript(context.Context, *DeleteScriptRequest) (*DeleteScriptResponse, error) - SetScripts(context.Context, *SetScriptsRequest) (*SetScriptsResponse, error) - RecordExecutionResult(context.Context, *RecordExecutionResultRequest) (*RecordExecutionResultResponse, error) - GetAllExecutionResults(context.Context, *GetAllExecutionResultsRequest) (*GetAllExecutionResultsResponse, error) +// MetadataServiceServer is the server API for MetadataService service. +type MetadataServiceServer interface { + GetAgentUpdates(*AgentUpdatesRequest, MetadataService_GetAgentUpdatesServer) error + GetSchemas(context.Context, *SchemaRequest) (*SchemaResponse, error) + GetAgentInfo(context.Context, *AgentInfoRequest) (*AgentInfoResponse, error) + GetWithPrefixKey(context.Context, *WithPrefixKeyRequest) (*WithPrefixKeyResponse, error) } -// UnimplementedCronScriptStoreServiceServer can be embedded to have forward compatible implementations. -type UnimplementedCronScriptStoreServiceServer struct { +// UnimplementedMetadataServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetadataServiceServer struct { } -func (*UnimplementedCronScriptStoreServiceServer) GetScripts(ctx context.Context, req *GetScriptsRequest) (*GetScriptsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetScripts not implemented") +func (*UnimplementedMetadataServiceServer) GetAgentUpdates(req *AgentUpdatesRequest, srv MetadataService_GetAgentUpdatesServer) error { + return status.Errorf(codes.Unimplemented, "method GetAgentUpdates not implemented") } -func (*UnimplementedCronScriptStoreServiceServer) AddOrUpdateScript(ctx context.Context, req *AddOrUpdateScriptRequest) (*AddOrUpdateScriptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddOrUpdateScript not implemented") +func (*UnimplementedMetadataServiceServer) GetSchemas(ctx context.Context, req *SchemaRequest) (*SchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSchemas not implemented") } -func (*UnimplementedCronScriptStoreServiceServer) DeleteScript(ctx context.Context, req *DeleteScriptRequest) (*DeleteScriptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteScript not implemented") +func (*UnimplementedMetadataServiceServer) GetAgentInfo(ctx context.Context, req *AgentInfoRequest) (*AgentInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAgentInfo not implemented") } -func (*UnimplementedCronScriptStoreServiceServer) SetScripts(ctx context.Context, req *SetScriptsRequest) (*SetScriptsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetScripts not implemented") +func (*UnimplementedMetadataServiceServer) GetWithPrefixKey(ctx context.Context, req *WithPrefixKeyRequest) (*WithPrefixKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWithPrefixKey not implemented") } -func (*UnimplementedCronScriptStoreServiceServer) RecordExecutionResult(ctx context.Context, req *RecordExecutionResultRequest) (*RecordExecutionResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RecordExecutionResult not implemented") + +func RegisterMetadataServiceServer(s *grpc.Server, srv MetadataServiceServer) { + s.RegisterService(&_MetadataService_serviceDesc, srv) } -func (*UnimplementedCronScriptStoreServiceServer) GetAllExecutionResults(ctx context.Context, req *GetAllExecutionResultsRequest) (*GetAllExecutionResultsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAllExecutionResults not implemented") + +func _MetadataService_GetAgentUpdates_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AgentUpdatesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MetadataServiceServer).GetAgentUpdates(m, &metadataServiceGetAgentUpdatesServer{stream}) } -func RegisterCronScriptStoreServiceServer(s *grpc.Server, srv CronScriptStoreServiceServer) { - s.RegisterService(&_CronScriptStoreService_serviceDesc, srv) +type MetadataService_GetAgentUpdatesServer interface { + Send(*AgentUpdatesResponse) error + grpc.ServerStream } -func _CronScriptStoreService_GetScripts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetScriptsRequest) +type metadataServiceGetAgentUpdatesServer struct { + grpc.ServerStream +} + +func (x *metadataServiceGetAgentUpdatesServer) Send(m *AgentUpdatesResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _MetadataService_GetSchemas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SchemaRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).GetScripts(ctx, in) + return srv.(MetadataServiceServer).GetSchemas(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/GetScripts", + FullMethod: "/px.vizier.services.metadata.MetadataService/GetSchemas", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).GetScripts(ctx, req.(*GetScriptsRequest)) + return srv.(MetadataServiceServer).GetSchemas(ctx, req.(*SchemaRequest)) } return interceptor(ctx, in, info, handler) } -func _CronScriptStoreService_AddOrUpdateScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddOrUpdateScriptRequest) +func _MetadataService_GetAgentInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AgentInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).AddOrUpdateScript(ctx, in) + return srv.(MetadataServiceServer).GetAgentInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/AddOrUpdateScript", + FullMethod: "/px.vizier.services.metadata.MetadataService/GetAgentInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).AddOrUpdateScript(ctx, req.(*AddOrUpdateScriptRequest)) + return srv.(MetadataServiceServer).GetAgentInfo(ctx, req.(*AgentInfoRequest)) } return interceptor(ctx, in, info, handler) } -func _CronScriptStoreService_DeleteScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteScriptRequest) +func _MetadataService_GetWithPrefixKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WithPrefixKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).DeleteScript(ctx, in) + return srv.(MetadataServiceServer).GetWithPrefixKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/DeleteScript", + FullMethod: "/px.vizier.services.metadata.MetadataService/GetWithPrefixKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).DeleteScript(ctx, req.(*DeleteScriptRequest)) + return srv.(MetadataServiceServer).GetWithPrefixKey(ctx, req.(*WithPrefixKeyRequest)) } return interceptor(ctx, in, info, handler) } -func _CronScriptStoreService_SetScripts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetScriptsRequest) +var _MetadataService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "px.vizier.services.metadata.MetadataService", + HandlerType: (*MetadataServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSchemas", + Handler: _MetadataService_GetSchemas_Handler, + }, + { + MethodName: "GetAgentInfo", + Handler: _MetadataService_GetAgentInfo_Handler, + }, + { + MethodName: "GetWithPrefixKey", + Handler: _MetadataService_GetWithPrefixKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetAgentUpdates", + Handler: _MetadataService_GetAgentUpdates_Handler, + ServerStreams: true, + }, + }, + Metadata: "src/vizier/services/metadata/metadatapb/service.proto", +} + +// MetadataFileSourceServiceClient is the client API for MetadataFileSourceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MetadataFileSourceServiceClient interface { + RegisterFileSource(ctx context.Context, in *RegisterFileSourceRequest, opts ...grpc.CallOption) (*RegisterFileSourceResponse, error) + GetFileSourceInfo(ctx context.Context, in *GetFileSourceInfoRequest, opts ...grpc.CallOption) (*GetFileSourceInfoResponse, error) + RemoveFileSource(ctx context.Context, in *RemoveFileSourceRequest, opts ...grpc.CallOption) (*RemoveFileSourceResponse, error) +} + +type metadataFileSourceServiceClient struct { + cc *grpc.ClientConn +} + +func NewMetadataFileSourceServiceClient(cc *grpc.ClientConn) MetadataFileSourceServiceClient { + return &metadataFileSourceServiceClient{cc} +} + +func (c *metadataFileSourceServiceClient) RegisterFileSource(ctx context.Context, in *RegisterFileSourceRequest, opts ...grpc.CallOption) (*RegisterFileSourceResponse, error) { + out := new(RegisterFileSourceResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataFileSourceService/RegisterFileSource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metadataFileSourceServiceClient) GetFileSourceInfo(ctx context.Context, in *GetFileSourceInfoRequest, opts ...grpc.CallOption) (*GetFileSourceInfoResponse, error) { + out := new(GetFileSourceInfoResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataFileSourceService/GetFileSourceInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metadataFileSourceServiceClient) RemoveFileSource(ctx context.Context, in *RemoveFileSourceRequest, opts ...grpc.CallOption) (*RemoveFileSourceResponse, error) { + out := new(RemoveFileSourceResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataFileSourceService/RemoveFileSource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetadataFileSourceServiceServer is the server API for MetadataFileSourceService service. +type MetadataFileSourceServiceServer interface { + RegisterFileSource(context.Context, *RegisterFileSourceRequest) (*RegisterFileSourceResponse, error) + GetFileSourceInfo(context.Context, *GetFileSourceInfoRequest) (*GetFileSourceInfoResponse, error) + RemoveFileSource(context.Context, *RemoveFileSourceRequest) (*RemoveFileSourceResponse, error) +} + +// UnimplementedMetadataFileSourceServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetadataFileSourceServiceServer struct { +} + +func (*UnimplementedMetadataFileSourceServiceServer) RegisterFileSource(ctx context.Context, req *RegisterFileSourceRequest) (*RegisterFileSourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterFileSource not implemented") +} +func (*UnimplementedMetadataFileSourceServiceServer) GetFileSourceInfo(ctx context.Context, req *GetFileSourceInfoRequest) (*GetFileSourceInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFileSourceInfo not implemented") +} +func (*UnimplementedMetadataFileSourceServiceServer) RemoveFileSource(ctx context.Context, req *RemoveFileSourceRequest) (*RemoveFileSourceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveFileSource not implemented") +} + +func RegisterMetadataFileSourceServiceServer(s *grpc.Server, srv MetadataFileSourceServiceServer) { + s.RegisterService(&_MetadataFileSourceService_serviceDesc, srv) +} + +func _MetadataFileSourceService_RegisterFileSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterFileSourceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).SetScripts(ctx, in) + return srv.(MetadataFileSourceServiceServer).RegisterFileSource(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/SetScripts", + FullMethod: "/px.vizier.services.metadata.MetadataFileSourceService/RegisterFileSource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).SetScripts(ctx, req.(*SetScriptsRequest)) + return srv.(MetadataFileSourceServiceServer).RegisterFileSource(ctx, req.(*RegisterFileSourceRequest)) } return interceptor(ctx, in, info, handler) } -func _CronScriptStoreService_RecordExecutionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RecordExecutionResultRequest) +func _MetadataFileSourceService_GetFileSourceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFileSourceInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).RecordExecutionResult(ctx, in) + return srv.(MetadataFileSourceServiceServer).GetFileSourceInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/RecordExecutionResult", + FullMethod: "/px.vizier.services.metadata.MetadataFileSourceService/GetFileSourceInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).RecordExecutionResult(ctx, req.(*RecordExecutionResultRequest)) + return srv.(MetadataFileSourceServiceServer).GetFileSourceInfo(ctx, req.(*GetFileSourceInfoRequest)) } return interceptor(ctx, in, info, handler) } -func _CronScriptStoreService_GetAllExecutionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAllExecutionResultsRequest) +func _MetadataFileSourceService_RemoveFileSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveFileSourceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CronScriptStoreServiceServer).GetAllExecutionResults(ctx, in) + return srv.(MetadataFileSourceServiceServer).RemoveFileSource(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/GetAllExecutionResults", + FullMethod: "/px.vizier.services.metadata.MetadataFileSourceService/RemoveFileSource", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CronScriptStoreServiceServer).GetAllExecutionResults(ctx, req.(*GetAllExecutionResultsRequest)) + return srv.(MetadataFileSourceServiceServer).RemoveFileSource(ctx, req.(*RemoveFileSourceRequest)) } return interceptor(ctx, in, info, handler) } -var _CronScriptStoreService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "px.vizier.services.metadata.CronScriptStoreService", - HandlerType: (*CronScriptStoreServiceServer)(nil), +var _MetadataFileSourceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "px.vizier.services.metadata.MetadataFileSourceService", + HandlerType: (*MetadataFileSourceServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetScripts", - Handler: _CronScriptStoreService_GetScripts_Handler, - }, - { - MethodName: "AddOrUpdateScript", - Handler: _CronScriptStoreService_AddOrUpdateScript_Handler, - }, - { - MethodName: "DeleteScript", - Handler: _CronScriptStoreService_DeleteScript_Handler, - }, - { - MethodName: "SetScripts", - Handler: _CronScriptStoreService_SetScripts_Handler, + MethodName: "RegisterFileSource", + Handler: _MetadataFileSourceService_RegisterFileSource_Handler, }, { - MethodName: "RecordExecutionResult", - Handler: _CronScriptStoreService_RecordExecutionResult_Handler, + MethodName: "GetFileSourceInfo", + Handler: _MetadataFileSourceService_GetFileSourceInfo_Handler, }, { - MethodName: "GetAllExecutionResults", - Handler: _CronScriptStoreService_GetAllExecutionResults_Handler, + MethodName: "RemoveFileSource", + Handler: _MetadataFileSourceService_RemoveFileSource_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "src/vizier/services/metadata/metadatapb/service.proto", } -func (m *SchemaRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +// MetadataTracepointServiceClient is the client API for MetadataTracepointService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MetadataTracepointServiceClient interface { + RegisterTracepoint(ctx context.Context, in *RegisterTracepointRequest, opts ...grpc.CallOption) (*RegisterTracepointResponse, error) + GetTracepointInfo(ctx context.Context, in *GetTracepointInfoRequest, opts ...grpc.CallOption) (*GetTracepointInfoResponse, error) + RemoveTracepoint(ctx context.Context, in *RemoveTracepointRequest, opts ...grpc.CallOption) (*RemoveTracepointResponse, error) } -func (m *SchemaRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type metadataTracepointServiceClient struct { + cc *grpc.ClientConn } -func (m *SchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func NewMetadataTracepointServiceClient(cc *grpc.ClientConn) MetadataTracepointServiceClient { + return &metadataTracepointServiceClient{cc} } -func (m *SchemaResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *metadataTracepointServiceClient) RegisterTracepoint(ctx context.Context, in *RegisterTracepointRequest, opts ...grpc.CallOption) (*RegisterTracepointResponse, error) { + out := new(RegisterTracepointResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/RegisterTracepoint", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *SchemaResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return out, nil } -func (m *SchemaResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Schema != nil { - { - size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (c *metadataTracepointServiceClient) GetTracepointInfo(ctx context.Context, in *GetTracepointInfoRequest, opts ...grpc.CallOption) (*GetTracepointInfoResponse, error) { + out := new(GetTracepointInfoResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/GetTracepointInfo", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *AgentInfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *metadataTracepointServiceClient) RemoveTracepoint(ctx context.Context, in *RemoveTracepointRequest, opts ...grpc.CallOption) (*RemoveTracepointResponse, error) { + out := new(RemoveTracepointResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataTracepointService/RemoveTracepoint", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *AgentInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// MetadataTracepointServiceServer is the server API for MetadataTracepointService service. +type MetadataTracepointServiceServer interface { + RegisterTracepoint(context.Context, *RegisterTracepointRequest) (*RegisterTracepointResponse, error) + GetTracepointInfo(context.Context, *GetTracepointInfoRequest) (*GetTracepointInfoResponse, error) + RemoveTracepoint(context.Context, *RemoveTracepointRequest) (*RemoveTracepointResponse, error) } -func (m *AgentInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +// UnimplementedMetadataTracepointServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetadataTracepointServiceServer struct { } -func (m *AgentInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (*UnimplementedMetadataTracepointServiceServer) RegisterTracepoint(ctx context.Context, req *RegisterTracepointRequest) (*RegisterTracepointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterTracepoint not implemented") +} +func (*UnimplementedMetadataTracepointServiceServer) GetTracepointInfo(ctx context.Context, req *GetTracepointInfoRequest) (*GetTracepointInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTracepointInfo not implemented") +} +func (*UnimplementedMetadataTracepointServiceServer) RemoveTracepoint(ctx context.Context, req *RemoveTracepointRequest) (*RemoveTracepointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveTracepoint not implemented") } -func (m *AgentInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterMetadataTracepointServiceServer(s *grpc.Server, srv MetadataTracepointServiceServer) { + s.RegisterService(&_MetadataTracepointService_serviceDesc, srv) } -func (m *AgentInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Info) > 0 { - for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } +func _MetadataTracepointService_RegisterTracepoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterTracepointRequest) + if err := dec(in); err != nil { + return nil, err } - return len(dAtA) - i, nil + if interceptor == nil { + return srv.(MetadataTracepointServiceServer).RegisterTracepoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/RegisterTracepoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetadataTracepointServiceServer).RegisterTracepoint(ctx, req.(*RegisterTracepointRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *AgentMetadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _MetadataTracepointService_GetTracepointInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTracepointInfoRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MetadataTracepointServiceServer).GetTracepointInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/GetTracepointInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetadataTracepointServiceServer).GetTracepointInfo(ctx, req.(*GetTracepointInfoRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *AgentMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _MetadataTracepointService_RemoveTracepoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveTracepointRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetadataTracepointServiceServer).RemoveTracepoint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.MetadataTracepointService/RemoveTracepoint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetadataTracepointServiceServer).RemoveTracepoint(ctx, req.(*RemoveTracepointRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *AgentMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CarnotInfo != nil { +var _MetadataTracepointService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "px.vizier.services.metadata.MetadataTracepointService", + HandlerType: (*MetadataTracepointServiceServer)(nil), + Methods: []grpc.MethodDesc{ { - size, err := m.CarnotInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Status != nil { + MethodName: "RegisterTracepoint", + Handler: _MetadataTracepointService_RegisterTracepoint_Handler, + }, { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Agent != nil { + MethodName: "GetTracepointInfo", + Handler: _MetadataTracepointService_GetTracepointInfo_Handler, + }, { - size, err := m.Agent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil + MethodName: "RemoveTracepoint", + Handler: _MetadataTracepointService_RemoveTracepoint_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "src/vizier/services/metadata/metadatapb/service.proto", } -func (m *AgentUpdatesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +// MetadataConfigServiceClient is the client API for MetadataConfigService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MetadataConfigServiceClient interface { + UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) +} + +type metadataConfigServiceClient struct { + cc *grpc.ClientConn +} + +func NewMetadataConfigServiceClient(cc *grpc.ClientConn) MetadataConfigServiceClient { + return &metadataConfigServiceClient{cc} +} + +func (c *metadataConfigServiceClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*UpdateConfigResponse, error) { + out := new(UpdateConfigResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.MetadataConfigService/UpdateConfig", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *AgentUpdatesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// MetadataConfigServiceServer is the server API for MetadataConfigService service. +type MetadataConfigServiceServer interface { + UpdateConfig(context.Context, *UpdateConfigRequest) (*UpdateConfigResponse, error) } -func (m *AgentUpdatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxUpdatesPerResponse != 0 { - i = encodeVarintService(dAtA, i, uint64(m.MaxUpdatesPerResponse)) - i-- - dAtA[i] = 0x10 - } - if m.MaxUpdateInterval != nil { - { - size, err := m.MaxUpdateInterval.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// UnimplementedMetadataConfigServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetadataConfigServiceServer struct { } -func (m *AgentUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (*UnimplementedMetadataConfigServiceServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*UpdateConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented") } -func (m *AgentUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterMetadataConfigServiceServer(s *grpc.Server, srv MetadataConfigServiceServer) { + s.RegisterService(&_MetadataConfigService_serviceDesc, srv) } -func (m *AgentUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Update != nil { - { - size := m.Update.Size() - i -= size - if _, err := m.Update.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } +func _MetadataConfigService_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateConfigRequest) + if err := dec(in); err != nil { + return nil, err } - if m.AgentID != nil { - { - size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(MetadataConfigServiceServer).UpdateConfig(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.MetadataConfigService/UpdateConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetadataConfigServiceServer).UpdateConfig(ctx, req.(*UpdateConfigRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *AgentUpdate_Deleted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +var _MetadataConfigService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "px.vizier.services.metadata.MetadataConfigService", + HandlerType: (*MetadataConfigServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateConfig", + Handler: _MetadataConfigService_UpdateConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "src/vizier/services/metadata/metadatapb/service.proto", } -func (m *AgentUpdate_Deleted) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i-- - if m.Deleted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - return len(dAtA) - i, nil -} -func (m *AgentUpdate_Agent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// CronScriptStoreServiceClient is the client API for CronScriptStoreService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CronScriptStoreServiceClient interface { + GetScripts(ctx context.Context, in *GetScriptsRequest, opts ...grpc.CallOption) (*GetScriptsResponse, error) + AddOrUpdateScript(ctx context.Context, in *AddOrUpdateScriptRequest, opts ...grpc.CallOption) (*AddOrUpdateScriptResponse, error) + DeleteScript(ctx context.Context, in *DeleteScriptRequest, opts ...grpc.CallOption) (*DeleteScriptResponse, error) + SetScripts(ctx context.Context, in *SetScriptsRequest, opts ...grpc.CallOption) (*SetScriptsResponse, error) + RecordExecutionResult(ctx context.Context, in *RecordExecutionResultRequest, opts ...grpc.CallOption) (*RecordExecutionResultResponse, error) + GetAllExecutionResults(ctx context.Context, in *GetAllExecutionResultsRequest, opts ...grpc.CallOption) (*GetAllExecutionResultsResponse, error) } -func (m *AgentUpdate_Agent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Agent != nil { - { - size, err := m.Agent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil +type cronScriptStoreServiceClient struct { + cc *grpc.ClientConn } -func (m *AgentUpdate_DataInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + +func NewCronScriptStoreServiceClient(cc *grpc.ClientConn) CronScriptStoreServiceClient { + return &cronScriptStoreServiceClient{cc} } -func (m *AgentUpdate_DataInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DataInfo != nil { - { - size, err := m.DataInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 +func (c *cronScriptStoreServiceClient) GetScripts(ctx context.Context, in *GetScriptsRequest, opts ...grpc.CallOption) (*GetScriptsResponse, error) { + out := new(GetScriptsResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/GetScripts", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *AgentUpdatesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + +func (c *cronScriptStoreServiceClient) AddOrUpdateScript(ctx context.Context, in *AddOrUpdateScriptRequest, opts ...grpc.CallOption) (*AddOrUpdateScriptResponse, error) { + out := new(AddOrUpdateScriptResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/AddOrUpdateScript", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *AgentUpdatesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *cronScriptStoreServiceClient) DeleteScript(ctx context.Context, in *DeleteScriptRequest, opts ...grpc.CallOption) (*DeleteScriptResponse, error) { + out := new(DeleteScriptResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/DeleteScript", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *AgentUpdatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.EndOfVersion { - i-- - if m.EndOfVersion { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.AgentSchemasUpdated { - i-- - if m.AgentSchemasUpdated { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.AgentSchemas) > 0 { - for iNdEx := len(m.AgentSchemas) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AgentSchemas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (c *cronScriptStoreServiceClient) SetScripts(ctx context.Context, in *SetScriptsRequest, opts ...grpc.CallOption) (*SetScriptsResponse, error) { + out := new(SetScriptsResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/SetScripts", in, out, opts...) + if err != nil { + return nil, err } - if len(m.AgentUpdates) > 0 { - for iNdEx := len(m.AgentUpdates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AgentUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + return out, nil +} + +func (c *cronScriptStoreServiceClient) RecordExecutionResult(ctx context.Context, in *RecordExecutionResultRequest, opts ...grpc.CallOption) (*RecordExecutionResultResponse, error) { + out := new(RecordExecutionResultResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/RecordExecutionResult", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *WithPrefixKeyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *cronScriptStoreServiceClient) GetAllExecutionResults(ctx context.Context, in *GetAllExecutionResultsRequest, opts ...grpc.CallOption) (*GetAllExecutionResultsResponse, error) { + out := new(GetAllExecutionResultsResponse) + err := c.cc.Invoke(ctx, "/px.vizier.services.metadata.CronScriptStoreService/GetAllExecutionResults", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *WithPrefixKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// CronScriptStoreServiceServer is the server API for CronScriptStoreService service. +type CronScriptStoreServiceServer interface { + GetScripts(context.Context, *GetScriptsRequest) (*GetScriptsResponse, error) + AddOrUpdateScript(context.Context, *AddOrUpdateScriptRequest) (*AddOrUpdateScriptResponse, error) + DeleteScript(context.Context, *DeleteScriptRequest) (*DeleteScriptResponse, error) + SetScripts(context.Context, *SetScriptsRequest) (*SetScriptsResponse, error) + RecordExecutionResult(context.Context, *RecordExecutionResultRequest) (*RecordExecutionResultResponse, error) + GetAllExecutionResults(context.Context, *GetAllExecutionResultsRequest) (*GetAllExecutionResultsResponse, error) } -func (m *WithPrefixKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proto) > 0 { - i -= len(m.Proto) - copy(dAtA[i:], m.Proto) - i = encodeVarintService(dAtA, i, uint64(len(m.Proto))) - i-- - dAtA[i] = 0x12 +// UnimplementedCronScriptStoreServiceServer can be embedded to have forward compatible implementations. +type UnimplementedCronScriptStoreServiceServer struct { +} + +func (*UnimplementedCronScriptStoreServiceServer) GetScripts(ctx context.Context, req *GetScriptsRequest) (*GetScriptsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetScripts not implemented") +} +func (*UnimplementedCronScriptStoreServiceServer) AddOrUpdateScript(ctx context.Context, req *AddOrUpdateScriptRequest) (*AddOrUpdateScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddOrUpdateScript not implemented") +} +func (*UnimplementedCronScriptStoreServiceServer) DeleteScript(ctx context.Context, req *DeleteScriptRequest) (*DeleteScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteScript not implemented") +} +func (*UnimplementedCronScriptStoreServiceServer) SetScripts(ctx context.Context, req *SetScriptsRequest) (*SetScriptsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetScripts not implemented") +} +func (*UnimplementedCronScriptStoreServiceServer) RecordExecutionResult(ctx context.Context, req *RecordExecutionResultRequest) (*RecordExecutionResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecordExecutionResult not implemented") +} +func (*UnimplementedCronScriptStoreServiceServer) GetAllExecutionResults(ctx context.Context, req *GetAllExecutionResultsRequest) (*GetAllExecutionResultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllExecutionResults not implemented") +} + +func RegisterCronScriptStoreServiceServer(s *grpc.Server, srv CronScriptStoreServiceServer) { + s.RegisterService(&_CronScriptStoreService_serviceDesc, srv) +} + +func _CronScriptStoreService_GetScripts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetScriptsRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.Prefix) > 0 { - i -= len(m.Prefix) - copy(dAtA[i:], m.Prefix) - i = encodeVarintService(dAtA, i, uint64(len(m.Prefix))) - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).GetScripts(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/GetScripts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).GetScripts(ctx, req.(*GetScriptsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *WithPrefixKeyResponse) Marshal() (dAtA []byte, err error) { +func _CronScriptStoreService_AddOrUpdateScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddOrUpdateScriptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).AddOrUpdateScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/AddOrUpdateScript", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).AddOrUpdateScript(ctx, req.(*AddOrUpdateScriptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CronScriptStoreService_DeleteScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteScriptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).DeleteScript(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/DeleteScript", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).DeleteScript(ctx, req.(*DeleteScriptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CronScriptStoreService_SetScripts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetScriptsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).SetScripts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/SetScripts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).SetScripts(ctx, req.(*SetScriptsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CronScriptStoreService_RecordExecutionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecordExecutionResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).RecordExecutionResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/RecordExecutionResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).RecordExecutionResult(ctx, req.(*RecordExecutionResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CronScriptStoreService_GetAllExecutionResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllExecutionResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CronScriptStoreServiceServer).GetAllExecutionResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/px.vizier.services.metadata.CronScriptStoreService/GetAllExecutionResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CronScriptStoreServiceServer).GetAllExecutionResults(ctx, req.(*GetAllExecutionResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CronScriptStoreService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "px.vizier.services.metadata.CronScriptStoreService", + HandlerType: (*CronScriptStoreServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetScripts", + Handler: _CronScriptStoreService_GetScripts_Handler, + }, + { + MethodName: "AddOrUpdateScript", + Handler: _CronScriptStoreService_AddOrUpdateScript_Handler, + }, + { + MethodName: "DeleteScript", + Handler: _CronScriptStoreService_DeleteScript_Handler, + }, + { + MethodName: "SetScripts", + Handler: _CronScriptStoreService_SetScripts_Handler, + }, + { + MethodName: "RecordExecutionResult", + Handler: _CronScriptStoreService_RecordExecutionResult_Handler, + }, + { + MethodName: "GetAllExecutionResults", + Handler: _CronScriptStoreService_GetAllExecutionResults_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "src/vizier/services/metadata/metadatapb/service.proto", +} + +func (m *SchemaRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4910,34 +5417,20 @@ func (m *WithPrefixKeyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WithPrefixKeyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SchemaRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WithPrefixKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Kvs) > 0 { - for iNdEx := len(m.Kvs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Kvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } -func (m *WithPrefixKeyResponse_KV) Marshal() (dAtA []byte, err error) { +func (m *SchemaResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4947,34 +5440,32 @@ func (m *WithPrefixKeyResponse_KV) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WithPrefixKeyResponse_KV) MarshalTo(dAtA []byte) (int, error) { +func (m *SchemaResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WithPrefixKeyResponse_KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SchemaResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintService(dAtA, i, uint64(len(m.Value))) + if m.Schema != nil { + { + size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintService(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *RegisterTracepointRequest) Marshal() (dAtA []byte, err error) { +func (m *AgentInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4984,34 +5475,20 @@ func (m *RegisterTracepointRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RegisterTracepointRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RegisterTracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Requests) > 0 { - for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } -func (m *RegisterTracepointRequest_TracepointRequest) Marshal() (dAtA []byte, err error) { +func (m *AgentInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5021,38 +5498,80 @@ func (m *RegisterTracepointRequest_TracepointRequest) Marshal() (dAtA []byte, er return dAtA[:n], nil } -func (m *RegisterTracepointRequest_TracepointRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RegisterTracepointRequest_TracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TTL != nil { - { - size, err := m.TTL.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *AgentMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AgentMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CarnotInfo != nil { + { + size, err := m.CarnotInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } i -= size i = encodeVarintService(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if m.TracepointDeployment != nil { + if m.Agent != nil { { - size, err := m.TracepointDeployment.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Agent.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5065,7 +5584,7 @@ func (m *RegisterTracepointRequest_TracepointRequest) MarshalToSizedBuffer(dAtA return len(dAtA) - i, nil } -func (m *RegisterTracepointResponse) Marshal() (dAtA []byte, err error) { +func (m *AgentUpdatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5075,19 +5594,24 @@ func (m *RegisterTracepointResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RegisterTracepointResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentUpdatesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RegisterTracepointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentUpdatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Status != nil { + if m.MaxUpdatesPerResponse != 0 { + i = encodeVarintService(dAtA, i, uint64(m.MaxUpdatesPerResponse)) + i-- + dAtA[i] = 0x10 + } + if m.MaxUpdateInterval != nil { { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.MaxUpdateInterval.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5095,26 +5619,12 @@ func (m *RegisterTracepointResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if len(m.Tracepoints) > 0 { - for iNdEx := len(m.Tracepoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tracepoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RegisterTracepointResponse_TracepointStatus) Marshal() (dAtA []byte, err error) { +func (m *AgentUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5124,26 +5634,28 @@ func (m *RegisterTracepointResponse_TracepointStatus) Marshal() (dAtA []byte, er return dAtA[:n], nil } -func (m *RegisterTracepointResponse_TracepointStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RegisterTracepointResponse_TracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintService(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a + if m.Update != nil { + { + size := m.Update.Size() + i -= size + if _, err := m.Update.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - if m.ID != nil { + if m.AgentID != nil { { - size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5151,11 +5663,38 @@ func (m *RegisterTracepointResponse_TracepointStatus) MarshalToSizedBuffer(dAtA i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } - if m.Status != nil { + return len(dAtA) - i, nil +} + +func (m *AgentUpdate_Deleted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentUpdate_Deleted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.Deleted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *AgentUpdate_Agent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentUpdate_Agent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Agent != nil { { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Agent.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5163,12 +5702,32 @@ func (m *RegisterTracepointResponse_TracepointStatus) MarshalToSizedBuffer(dAtA i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a } return len(dAtA) - i, nil } +func (m *AgentUpdate_DataInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} -func (m *GetTracepointInfoRequest) Marshal() (dAtA []byte, err error) { +func (m *AgentUpdate_DataInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DataInfo != nil { + { + size, err := m.DataInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *AgentUpdatesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5178,20 +5737,54 @@ func (m *GetTracepointInfoRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetTracepointInfoRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentUpdatesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTracepointInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentUpdatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.IDs) > 0 { - for iNdEx := len(m.IDs) - 1; iNdEx >= 0; iNdEx-- { + if m.EndOfVersion { + i-- + if m.EndOfVersion { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AgentSchemasUpdated { + i-- + if m.AgentSchemasUpdated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.AgentSchemas) > 0 { + for iNdEx := len(m.AgentSchemas) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.IDs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AgentSchemas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.AgentUpdates) > 0 { + for iNdEx := len(m.AgentUpdates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AgentUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5205,7 +5798,7 @@ func (m *GetTracepointInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *GetTracepointInfoResponse) Marshal() (dAtA []byte, err error) { +func (m *WithPrefixKeyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5215,34 +5808,34 @@ func (m *GetTracepointInfoResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetTracepointInfoResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *WithPrefixKeyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTracepointInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WithPrefixKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Tracepoints) > 0 { - for iNdEx := len(m.Tracepoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tracepoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if len(m.Proto) > 0 { + i -= len(m.Proto) + copy(dAtA[i:], m.Proto) + i = encodeVarintService(dAtA, i, uint64(len(m.Proto))) + i-- + dAtA[i] = 0x12 + } + if len(m.Prefix) > 0 { + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintService(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *GetTracepointInfoResponse_TracepointState) Marshal() (dAtA []byte, err error) { +func (m *WithPrefixKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5252,41 +5845,20 @@ func (m *GetTracepointInfoResponse_TracepointState) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *GetTracepointInfoResponse_TracepointState) MarshalTo(dAtA []byte) (int, error) { +func (m *WithPrefixKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTracepointInfoResponse_TracepointState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WithPrefixKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.SchemaNames) > 0 { - for iNdEx := len(m.SchemaNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.SchemaNames[iNdEx]) - copy(dAtA[i:], m.SchemaNames[iNdEx]) - i = encodeVarintService(dAtA, i, uint64(len(m.SchemaNames[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if m.ExpectedState != 0 { - i = encodeVarintService(dAtA, i, uint64(m.ExpectedState)) - i-- - dAtA[i] = 0x28 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintService(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - } - if len(m.Statuses) > 0 { - for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Kvs) > 0 { + for iNdEx := len(m.Kvs) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Kvs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5294,30 +5866,13 @@ func (m *GetTracepointInfoResponse_TracepointState) MarshalToSizedBuffer(dAtA [] i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - } - if m.State != 0 { - i = encodeVarintService(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x10 - } - if m.ID != nil { - { - size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RemoveTracepointRequest) Marshal() (dAtA []byte, err error) { +func (m *WithPrefixKeyResponse_KV) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5327,29 +5882,34 @@ func (m *RemoveTracepointRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveTracepointRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *WithPrefixKeyResponse_KV) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveTracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WithPrefixKeyResponse_KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintService(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintService(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintService(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RemoveTracepointResponse) Marshal() (dAtA []byte, err error) { +func (m *RegisterFileSourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5359,32 +5919,34 @@ func (m *RemoveTracepointResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveTracepointResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveTracepointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { +func (m *RegisterFileSourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5394,41 +5956,46 @@ func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateConfigRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterFileSourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterFileSourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.AgentPodName) > 0 { - i -= len(m.AgentPodName) - copy(dAtA[i:], m.AgentPodName) - i = encodeVarintService(dAtA, i, uint64(len(m.AgentPodName))) - i-- - dAtA[i] = 0x1a - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintService(dAtA, i, uint64(len(m.Value))) + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintService(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa + if len(m.FileSources) > 0 { + for iNdEx := len(m.FileSources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FileSources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { +func (m *RegisterFileSourceResponse_FileSourceStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5438,16 +6005,35 @@ func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateConfigResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterFileSourceResponse_FileSourceStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterFileSourceResponse_FileSourceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } if m.Status != nil { { size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) @@ -5463,7 +6049,7 @@ func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetScriptsRequest) Marshal() (dAtA []byte, err error) { +func (m *GetFileSourceInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5473,20 +6059,34 @@ func (m *GetScriptsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetScriptsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetScriptsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.IDs) > 0 { + for iNdEx := len(m.IDs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IDs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } -func (m *GetScriptsResponse) Marshal() (dAtA []byte, err error) { +func (m *GetFileSourceInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5496,38 +6096,26 @@ func (m *GetScriptsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetScriptsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetScriptsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Scripts) > 0 { - for k := range m.Scripts { - v := m.Scripts[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) + if len(m.FileSources) > 0 { + for iNdEx := len(m.FileSources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FileSources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintService(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintService(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -5535,7 +6123,7 @@ func (m *GetScriptsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AddOrUpdateScriptRequest) Marshal() (dAtA []byte, err error) { +func (m *GetFileSourceInfoResponse_FileSourceState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5545,19 +6133,59 @@ func (m *AddOrUpdateScriptRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AddOrUpdateScriptRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoResponse_FileSourceState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AddOrUpdateScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetFileSourceInfoResponse_FileSourceState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Script != nil { + if len(m.SchemaNames) > 0 { + for iNdEx := len(m.SchemaNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SchemaNames[iNdEx]) + copy(dAtA[i:], m.SchemaNames[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(m.SchemaNames[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.ExpectedState != 0 { + i = encodeVarintService(dAtA, i, uint64(m.ExpectedState)) + i-- + dAtA[i] = 0x28 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if len(m.Statuses) > 0 { + for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.State != 0 { + i = encodeVarintService(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x10 + } + if m.ID != nil { { - size, err := m.Script.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5570,7 +6198,7 @@ func (m *AddOrUpdateScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *AddOrUpdateScriptResponse) Marshal() (dAtA []byte, err error) { +func (m *RemoveFileSourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5580,22 +6208,31 @@ func (m *AddOrUpdateScriptResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AddOrUpdateScriptResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveFileSourceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AddOrUpdateScriptResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveFileSourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - return len(dAtA) - i, nil -} - -func (m *DeleteScriptRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *RemoveFileSourceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err @@ -5603,19 +6240,19 @@ func (m *DeleteScriptRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DeleteScriptRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveFileSourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DeleteScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveFileSourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ScriptID != nil { + if m.Status != nil { { - size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5628,30 +6265,7 @@ func (m *DeleteScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DeleteScriptResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteScriptResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteScriptResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *SetScriptsRequest) Marshal() (dAtA []byte, err error) { +func (m *RegisterTracepointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5661,38 +6275,26 @@ func (m *SetScriptsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SetScriptsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterTracepointRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SetScriptsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterTracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Scripts) > 0 { - for k := range m.Scripts { - v := m.Scripts[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintService(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintService(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -5700,30 +6302,7 @@ func (m *SetScriptsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SetScriptsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SetScriptsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SetScriptsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ExecutionStats) Marshal() (dAtA []byte, err error) { +func (m *RegisterTracepointRequest_TracepointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5733,40 +6312,51 @@ func (m *ExecutionStats) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecutionStats) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterTracepointRequest_TracepointRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterTracepointRequest_TracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.RecordsProcessed != 0 { - i = encodeVarintService(dAtA, i, uint64(m.RecordsProcessed)) - i-- - dAtA[i] = 0x20 - } - if m.BytesProcessed != 0 { - i = encodeVarintService(dAtA, i, uint64(m.BytesProcessed)) + if m.TTL != nil { + { + size, err := m.TTL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } - if m.CompilationTimeNs != 0 { - i = encodeVarintService(dAtA, i, uint64(m.CompilationTimeNs)) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.ExecutionTimeNs != 0 { - i = encodeVarintService(dAtA, i, uint64(m.ExecutionTimeNs)) + if m.TracepointDeployment != nil { + { + size, err := m.TracepointDeployment.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RecordExecutionResultRequest) Marshal() (dAtA []byte, err error) { +func (m *RegisterTracepointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5776,28 +6366,19 @@ func (m *RecordExecutionResultRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RecordExecutionResultRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterTracepointResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RecordExecutionResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterTracepointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Timestamp != nil { + if m.Status != nil { { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5807,31 +6388,53 @@ func (m *RecordExecutionResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x12 } - if m.ScriptID != nil { - { - size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Tracepoints) > 0 { + for iNdEx := len(m.Tracepoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tracepoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RecordExecutionResultRequest_Error) MarshalTo(dAtA []byte) (int, error) { +func (m *RegisterTracepointResponse_TracepointStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterTracepointResponse_TracepointStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RecordExecutionResultRequest_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RegisterTracepointResponse_TracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Error != nil { + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.ID != nil { { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5839,20 +6442,11 @@ func (m *RecordExecutionResultRequest_Error) MarshalToSizedBuffer(dAtA []byte) ( i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } - return len(dAtA) - i, nil -} -func (m *RecordExecutionResultRequest_ExecutionStats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordExecutionResultRequest_ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExecutionStats != nil { + if m.Status != nil { { - size, err := m.ExecutionStats.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5860,11 +6454,12 @@ func (m *RecordExecutionResultRequest_ExecutionStats) MarshalToSizedBuffer(dAtA i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RecordExecutionResultResponse) Marshal() (dAtA []byte, err error) { + +func (m *GetTracepointInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5874,20 +6469,34 @@ func (m *RecordExecutionResultResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RecordExecutionResultResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *GetTracepointInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RecordExecutionResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetTracepointInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.IDs) > 0 { + for iNdEx := len(m.IDs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IDs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } -func (m *GetAllExecutionResultsRequest) Marshal() (dAtA []byte, err error) { +func (m *GetTracepointInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5897,20 +6506,34 @@ func (m *GetAllExecutionResultsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetAllExecutionResultsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *GetTracepointInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetAllExecutionResultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetTracepointInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Tracepoints) > 0 { + for iNdEx := len(m.Tracepoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tracepoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } -func (m *GetAllExecutionResultsResponse) Marshal() (dAtA []byte, err error) { +func (m *GetTracepointInfoResponse_TracepointState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5920,20 +6543,41 @@ func (m *GetAllExecutionResultsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetAllExecutionResultsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *GetTracepointInfoResponse_TracepointState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetAllExecutionResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetTracepointInfoResponse_TracepointState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + if len(m.SchemaNames) > 0 { + for iNdEx := len(m.SchemaNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SchemaNames[iNdEx]) + copy(dAtA[i:], m.SchemaNames[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(m.SchemaNames[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.ExpectedState != 0 { + i = encodeVarintService(dAtA, i, uint64(m.ExpectedState)) + i-- + dAtA[i] = 0x28 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if len(m.Statuses) > 0 { + for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5941,13 +6585,30 @@ func (m *GetAllExecutionResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a + } + } + if m.State != 0 { + i = encodeVarintService(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x10 + } + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *GetAllExecutionResultsResponse_ExecutionResult) Marshal() (dAtA []byte, err error) { +func (m *RemoveTracepointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5957,40 +6618,51 @@ func (m *GetAllExecutionResultsResponse_ExecutionResult) Marshal() (dAtA []byte, return dAtA[:n], nil } -func (m *GetAllExecutionResultsResponse_ExecutionResult) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveTracepointRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetAllExecutionResultsResponse_ExecutionResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveTracepointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintService(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + return len(dAtA) - i, nil +} + +func (m *RemoveTracepointResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if m.ScriptID != nil { + return dAtA[:n], nil +} + +func (m *RemoveTracepointResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveTracepointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != nil { { - size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -6003,37 +6675,73 @@ func (m *GetAllExecutionResultsResponse_ExecutionResult) MarshalToSizedBuffer(dA return len(dAtA) - i, nil } -func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) MarshalTo(dAtA []byte) (int, error) { +func (m *UpdateConfigRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateConfigRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UpdateConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintService(dAtA, i, uint64(size)) - } + _ = i + var l int + _ = l + if len(m.AgentPodName) > 0 { + i -= len(m.AgentPodName) + copy(dAtA[i:], m.AgentPodName) + i = encodeVarintService(dAtA, i, uint64(len(m.AgentPodName))) i-- dAtA[i] = 0x1a } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintService(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintService(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) MarshalTo(dAtA []byte) (int, error) { + +func (m *UpdateConfigResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateConfigResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UpdateConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.ExecutionStats != nil { + _ = i + var l int + _ = l + if m.Status != nil { { - size, err := m.ExecutionStats.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -6041,613 +6749,627 @@ func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) MarshalT i = encodeVarintService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintService(dAtA []byte, offset int, v uint64) int { - offset -= sovService(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + +func (m *GetScriptsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *SchemaRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n + +func (m *GetScriptsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SchemaResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *GetScriptsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovService(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *AgentInfoRequest) Size() (n int) { - if m == nil { - return 0 +func (m *GetScriptsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *AgentInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Info) > 0 { - for _, e := range m.Info { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n +func (m *GetScriptsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AgentMetadata) Size() (n int) { - if m == nil { - return 0 - } +func (m *GetScriptsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Agent != nil { - l = m.Agent.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.CarnotInfo != nil { - l = m.CarnotInfo.Size() - n += 1 + l + sovService(uint64(l)) + if len(m.Scripts) > 0 { + for k := range m.Scripts { + v := m.Scripts[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } } - return n + return len(dAtA) - i, nil } -func (m *AgentUpdatesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxUpdateInterval != nil { - l = m.MaxUpdateInterval.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.MaxUpdatesPerResponse != 0 { - n += 1 + sovService(uint64(m.MaxUpdatesPerResponse)) +func (m *AddOrUpdateScriptRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *AgentUpdate) Size() (n int) { - if m == nil { - return 0 - } +func (m *AddOrUpdateScriptRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddOrUpdateScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.AgentID != nil { - l = m.AgentID.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.Update != nil { - n += m.Update.Size() + if m.Script != nil { + { + size, err := m.Script.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *AgentUpdate_Deleted) Size() (n int) { - if m == nil { - return 0 +func (m *AddOrUpdateScriptResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - n += 2 - return n + return dAtA[:n], nil } -func (m *AgentUpdate_Agent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Agent != nil { - l = m.Agent.Size() - n += 1 + l + sovService(uint64(l)) - } - return n + +func (m *AddOrUpdateScriptResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AgentUpdate_DataInfo) Size() (n int) { - if m == nil { - return 0 - } + +func (m *AddOrUpdateScriptResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.DataInfo != nil { - l = m.DataInfo.Size() - n += 1 + l + sovService(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *AgentUpdatesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.AgentUpdates) > 0 { - for _, e := range m.AgentUpdates { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - if len(m.AgentSchemas) > 0 { - for _, e := range m.AgentSchemas { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - if m.AgentSchemasUpdated { - n += 2 - } - if m.EndOfVersion { - n += 2 + +func (m *DeleteScriptRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *WithPrefixKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Prefix) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = len(m.Proto) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - return n +func (m *DeleteScriptRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WithPrefixKeyResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *DeleteScriptRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Kvs) > 0 { - for _, e := range m.Kvs { - l = e.Size() - n += 1 + l + sovService(uint64(l)) + if m.ScriptID != nil { + { + size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *WithPrefixKeyResponse_KV) Size() (n int) { - if m == nil { - return 0 +func (m *DeleteScriptResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *DeleteScriptResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteScriptResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *RegisterTracepointRequest) Size() (n int) { - if m == nil { - return 0 +func (m *SetScriptsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n + return dAtA[:n], nil } -func (m *RegisterTracepointRequest_TracepointRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TracepointDeployment != nil { - l = m.TracepointDeployment.Size() - n += 1 + l + sovService(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovService(uint64(l)) - } - if m.TTL != nil { - l = m.TTL.Size() - n += 1 + l + sovService(uint64(l)) - } - return n +func (m *SetScriptsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RegisterTracepointResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *SetScriptsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Tracepoints) > 0 { - for _, e := range m.Tracepoints { - l = e.Size() - n += 1 + l + sovService(uint64(l)) + if len(m.Scripts) > 0 { + for k := range m.Scripts { + v := m.Scripts[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovService(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *RegisterTracepointResponse_TracepointStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.ID != nil { - l = m.ID.Size() - n += 1 + l + sovService(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovService(uint64(l)) +func (m *SetScriptsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *GetTracepointInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.IDs) > 0 { - for _, e := range m.IDs { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n +func (m *SetScriptsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTracepointInfoResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *SetScriptsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Tracepoints) > 0 { - for _, e := range m.Tracepoints { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } - } - return n + return len(dAtA) - i, nil } -func (m *GetTracepointInfoResponse_TracepointState) Size() (n int) { - if m == nil { - return 0 +func (m *ExecutionStats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ExecutionStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ID != nil { - l = m.ID.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.State != 0 { - n += 1 + sovService(uint64(m.State)) - } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - l = e.Size() - n += 1 + l + sovService(uint64(l)) - } + if m.RecordsProcessed != 0 { + i = encodeVarintService(dAtA, i, uint64(m.RecordsProcessed)) + i-- + dAtA[i] = 0x20 } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovService(uint64(l)) + if m.BytesProcessed != 0 { + i = encodeVarintService(dAtA, i, uint64(m.BytesProcessed)) + i-- + dAtA[i] = 0x18 } - if m.ExpectedState != 0 { - n += 1 + sovService(uint64(m.ExpectedState)) + if m.CompilationTimeNs != 0 { + i = encodeVarintService(dAtA, i, uint64(m.CompilationTimeNs)) + i-- + dAtA[i] = 0x10 } - if len(m.SchemaNames) > 0 { - for _, s := range m.SchemaNames { - l = len(s) - n += 1 + l + sovService(uint64(l)) - } + if m.ExecutionTimeNs != 0 { + i = encodeVarintService(dAtA, i, uint64(m.ExecutionTimeNs)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *RemoveTracepointRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovService(uint64(l)) - } +func (m *RecordExecutionResultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RemoveTracepointResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovService(uint64(l)) - } - return n +func (m *RecordExecutionResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateConfigRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *RecordExecutionResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovService(uint64(l)) + if m.Result != nil { + { + size := m.Result.Size() + i -= size + if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovService(uint64(l)) + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - l = len(m.AgentPodName) - if l > 0 { - n += 1 + l + sovService(uint64(l)) + if m.ScriptID != nil { + { + size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *UpdateConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovService(uint64(l)) - } - return n +func (m *RecordExecutionResultRequest_Error) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetScriptsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *RecordExecutionResultRequest_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Error != nil { + { + size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - var l int - _ = l - return n + return len(dAtA) - i, nil +} +func (m *RecordExecutionResultRequest_ExecutionStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetScriptsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Scripts) > 0 { - for k, v := range m.Scripts { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovService(uint64(l)) +func (m *RecordExecutionResultRequest_ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExecutionStats != nil { + { + size, err := m.ExecutionStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + l - n += mapEntrySize + 1 + sovService(uint64(mapEntrySize)) + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - return n + return len(dAtA) - i, nil } - -func (m *AddOrUpdateScriptRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Script != nil { - l = m.Script.Size() - n += 1 + l + sovService(uint64(l)) +func (m *RecordExecutionResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *AddOrUpdateScriptResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (m *RecordExecutionResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DeleteScriptRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *RecordExecutionResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ScriptID != nil { - l = m.ScriptID.Size() - n += 1 + l + sovService(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *DeleteScriptResponse) Size() (n int) { - if m == nil { - return 0 +func (m *GetAllExecutionResultsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *GetAllExecutionResultsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAllExecutionResultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *SetScriptsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *GetAllExecutionResultsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *GetAllExecutionResultsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAllExecutionResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Scripts) > 0 { - for k, v := range m.Scripts { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovService(uint64(l)) + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) } - mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + l - n += mapEntrySize + 1 + sovService(uint64(mapEntrySize)) + i-- + dAtA[i] = 0xa } } - return n + return len(dAtA) - i, nil } -func (m *SetScriptsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *GetAllExecutionResultsResponse_ExecutionResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *ExecutionStats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExecutionTimeNs != 0 { - n += 1 + sovService(uint64(m.ExecutionTimeNs)) - } - if m.CompilationTimeNs != 0 { - n += 1 + sovService(uint64(m.CompilationTimeNs)) - } - if m.BytesProcessed != 0 { - n += 1 + sovService(uint64(m.BytesProcessed)) - } - if m.RecordsProcessed != 0 { - n += 1 + sovService(uint64(m.RecordsProcessed)) - } - return n +func (m *GetAllExecutionResultsResponse_ExecutionResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RecordExecutionResultRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *GetAllExecutionResultsResponse_ExecutionResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ScriptID != nil { - l = m.ScriptID.Size() - n += 1 + l + sovService(uint64(l)) + if m.Result != nil { + { + size := m.Result.Size() + i -= size + if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovService(uint64(l)) - } - if m.Result != nil { - n += m.Result.Size() + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - return n + if m.ScriptID != nil { + { + size, err := m.ScriptID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *RecordExecutionResultRequest_Error) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l +func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovService(uint64(l)) + { + size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - return n + return len(dAtA) - i, nil } -func (m *RecordExecutionResultRequest_ExecutionStats) Size() (n int) { +func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExecutionStats != nil { + { + size, err := m.ExecutionStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SchemaRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ExecutionStats != nil { - l = m.ExecutionStats.Size() - n += 1 + l + sovService(uint64(l)) - } return n } -func (m *RecordExecutionResultResponse) Size() (n int) { + +func (m *SchemaResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Schema != nil { + l = m.Schema.Size() + n += 1 + l + sovService(uint64(l)) + } return n } -func (m *GetAllExecutionResultsRequest) Size() (n int) { +func (m *AgentInfoRequest) Size() (n int) { if m == nil { return 0 } @@ -6656,14 +7378,14 @@ func (m *GetAllExecutionResultsRequest) Size() (n int) { return n } -func (m *GetAllExecutionResultsResponse) Size() (n int) { +func (m *AgentInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { + if len(m.Info) > 0 { + for _, e := range m.Info { l = e.Size() n += 1 + l + sovService(uint64(l)) } @@ -6671,586 +7393,1949 @@ func (m *GetAllExecutionResultsResponse) Size() (n int) { return n } -func (m *GetAllExecutionResultsResponse_ExecutionResult) Size() (n int) { +func (m *AgentMetadata) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ScriptID != nil { - l = m.ScriptID.Size() + if m.Agent != nil { + l = m.Agent.Size() n += 1 + l + sovService(uint64(l)) } - if m.Timestamp != nil { - l = m.Timestamp.Size() + if m.Status != nil { + l = m.Status.Size() n += 1 + l + sovService(uint64(l)) } - if m.Result != nil { - n += m.Result.Size() + if m.CarnotInfo != nil { + l = m.CarnotInfo.Size() + n += 1 + l + sovService(uint64(l)) } return n } -func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) Size() (n int) { +func (m *AgentUpdatesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Error != nil { - l = m.Error.Size() + if m.MaxUpdateInterval != nil { + l = m.MaxUpdateInterval.Size() n += 1 + l + sovService(uint64(l)) } + if m.MaxUpdatesPerResponse != 0 { + n += 1 + sovService(uint64(m.MaxUpdatesPerResponse)) + } return n } -func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) Size() (n int) { + +func (m *AgentUpdate) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ExecutionStats != nil { - l = m.ExecutionStats.Size() + if m.AgentID != nil { + l = m.AgentID.Size() n += 1 + l + sovService(uint64(l)) } + if m.Update != nil { + n += m.Update.Size() + } return n } -func sovService(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozService(x uint64) (n int) { - return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *SchemaRequest) String() string { - if this == nil { - return "nil" +func (m *AgentUpdate_Deleted) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&SchemaRequest{`, - `}`, - }, "") - return s + var l int + _ = l + n += 2 + return n } -func (this *SchemaResponse) String() string { - if this == nil { - return "nil" +func (m *AgentUpdate_Agent) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&SchemaResponse{`, - `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "Schema", "schemapb.Schema", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AgentInfoRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.Agent != nil { + l = m.Agent.Size() + n += 1 + l + sovService(uint64(l)) } - s := strings.Join([]string{`&AgentInfoRequest{`, - `}`, - }, "") - return s + return n } -func (this *AgentInfoResponse) String() string { - if this == nil { - return "nil" +func (m *AgentUpdate_DataInfo) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForInfo := "[]*AgentMetadata{" - for _, f := range this.Info { - repeatedStringForInfo += strings.Replace(f.String(), "AgentMetadata", "AgentMetadata", 1) + "," + var l int + _ = l + if m.DataInfo != nil { + l = m.DataInfo.Size() + n += 1 + l + sovService(uint64(l)) } - repeatedStringForInfo += "}" - s := strings.Join([]string{`&AgentInfoResponse{`, - `Info:` + repeatedStringForInfo + `,`, - `}`, - }, "") - return s + return n } -func (this *AgentMetadata) String() string { - if this == nil { - return "nil" +func (m *AgentUpdatesResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&AgentMetadata{`, - `Agent:` + strings.Replace(fmt.Sprintf("%v", this.Agent), "Agent", "agentpb.Agent", 1) + `,`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "AgentStatus", "agentpb.AgentStatus", 1) + `,`, - `CarnotInfo:` + strings.Replace(fmt.Sprintf("%v", this.CarnotInfo), "CarnotInfo", "distributedpb.CarnotInfo", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AgentUpdatesRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if len(m.AgentUpdates) > 0 { + for _, e := range m.AgentUpdates { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - s := strings.Join([]string{`&AgentUpdatesRequest{`, - `MaxUpdateInterval:` + strings.Replace(fmt.Sprintf("%v", this.MaxUpdateInterval), "Duration", "types.Duration", 1) + `,`, - `MaxUpdatesPerResponse:` + fmt.Sprintf("%v", this.MaxUpdatesPerResponse) + `,`, - `}`, - }, "") - return s -} -func (this *AgentUpdate) String() string { - if this == nil { - return "nil" + if len(m.AgentSchemas) > 0 { + for _, e := range m.AgentSchemas { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - s := strings.Join([]string{`&AgentUpdate{`, - `AgentID:` + strings.Replace(fmt.Sprintf("%v", this.AgentID), "UUID", "uuidpb.UUID", 1) + `,`, - `Update:` + fmt.Sprintf("%v", this.Update) + `,`, - `}`, - }, "") - return s -} -func (this *AgentUpdate_Deleted) String() string { - if this == nil { - return "nil" + if m.AgentSchemasUpdated { + n += 2 } - s := strings.Join([]string{`&AgentUpdate_Deleted{`, - `Deleted:` + fmt.Sprintf("%v", this.Deleted) + `,`, - `}`, - }, "") - return s -} -func (this *AgentUpdate_Agent) String() string { - if this == nil { - return "nil" + if m.EndOfVersion { + n += 2 } - s := strings.Join([]string{`&AgentUpdate_Agent{`, - `Agent:` + strings.Replace(fmt.Sprintf("%v", this.Agent), "Agent", "agentpb.Agent", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AgentUpdate_DataInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AgentUpdate_DataInfo{`, - `DataInfo:` + strings.Replace(fmt.Sprintf("%v", this.DataInfo), "AgentDataInfo", "messagespb.AgentDataInfo", 1) + `,`, - `}`, - }, "") - return s + return n } -func (this *AgentUpdatesResponse) String() string { - if this == nil { - return "nil" + +func (m *WithPrefixKeyRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForAgentUpdates := "[]*AgentUpdate{" - for _, f := range this.AgentUpdates { - repeatedStringForAgentUpdates += strings.Replace(f.String(), "AgentUpdate", "AgentUpdate", 1) + "," + var l int + _ = l + l = len(m.Prefix) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - repeatedStringForAgentUpdates += "}" - repeatedStringForAgentSchemas := "[]*SchemaInfo{" - for _, f := range this.AgentSchemas { - repeatedStringForAgentSchemas += strings.Replace(fmt.Sprintf("%v", f), "SchemaInfo", "distributedpb.SchemaInfo", 1) + "," + l = len(m.Proto) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - repeatedStringForAgentSchemas += "}" - s := strings.Join([]string{`&AgentUpdatesResponse{`, - `AgentUpdates:` + repeatedStringForAgentUpdates + `,`, - `AgentSchemas:` + repeatedStringForAgentSchemas + `,`, - `AgentSchemasUpdated:` + fmt.Sprintf("%v", this.AgentSchemasUpdated) + `,`, - `EndOfVersion:` + fmt.Sprintf("%v", this.EndOfVersion) + `,`, - `}`, - }, "") - return s + return n } -func (this *WithPrefixKeyRequest) String() string { - if this == nil { - return "nil" + +func (m *WithPrefixKeyResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&WithPrefixKeyRequest{`, - `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, - `Proto:` + fmt.Sprintf("%v", this.Proto) + `,`, - `}`, - }, "") - return s + var l int + _ = l + if len(m.Kvs) > 0 { + for _, e := range m.Kvs { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n } -func (this *WithPrefixKeyResponse) String() string { - if this == nil { - return "nil" + +func (m *WithPrefixKeyResponse_KV) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForKvs := "[]*WithPrefixKeyResponse_KV{" - for _, f := range this.Kvs { - repeatedStringForKvs += strings.Replace(fmt.Sprintf("%v", f), "WithPrefixKeyResponse_KV", "WithPrefixKeyResponse_KV", 1) + "," + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - repeatedStringForKvs += "}" - s := strings.Join([]string{`&WithPrefixKeyResponse{`, - `Kvs:` + repeatedStringForKvs + `,`, - `}`, - }, "") - return s -} -func (this *WithPrefixKeyResponse_KV) String() string { - if this == nil { - return "nil" + l = len(m.Value) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - s := strings.Join([]string{`&WithPrefixKeyResponse_KV{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s + return n } -func (this *RegisterTracepointRequest) String() string { - if this == nil { - return "nil" + +func (m *RegisterFileSourceRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForRequests := "[]*RegisterTracepointRequest_TracepointRequest{" - for _, f := range this.Requests { - repeatedStringForRequests += strings.Replace(fmt.Sprintf("%v", f), "RegisterTracepointRequest_TracepointRequest", "RegisterTracepointRequest_TracepointRequest", 1) + "," + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - repeatedStringForRequests += "}" - s := strings.Join([]string{`&RegisterTracepointRequest{`, - `Requests:` + repeatedStringForRequests + `,`, - `}`, - }, "") - return s + return n } -func (this *RegisterTracepointRequest_TracepointRequest) String() string { - if this == nil { - return "nil" + +func (m *RegisterFileSourceResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&RegisterTracepointRequest_TracepointRequest{`, - `TracepointDeployment:` + strings.Replace(fmt.Sprintf("%v", this.TracepointDeployment), "TracepointDeployment", "logicalpb.TracepointDeployment", 1) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `TTL:` + strings.Replace(fmt.Sprintf("%v", this.TTL), "Duration", "types.Duration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RegisterTracepointResponse) String() string { - if this == nil { - return "nil" + var l int + _ = l + if len(m.FileSources) > 0 { + for _, e := range m.FileSources { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - repeatedStringForTracepoints := "[]*RegisterTracepointResponse_TracepointStatus{" - for _, f := range this.Tracepoints { - repeatedStringForTracepoints += strings.Replace(fmt.Sprintf("%v", f), "RegisterTracepointResponse_TracepointStatus", "RegisterTracepointResponse_TracepointStatus", 1) + "," + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) } - repeatedStringForTracepoints += "}" - s := strings.Join([]string{`&RegisterTracepointResponse{`, - `Tracepoints:` + repeatedStringForTracepoints + `,`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, - `}`, - }, "") - return s + return n } -func (this *RegisterTracepointResponse_TracepointStatus) String() string { - if this == nil { - return "nil" + +func (m *RegisterFileSourceResponse_FileSourceStatus) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&RegisterTracepointResponse_TracepointStatus{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, - `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *GetTracepointInfoRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) } - repeatedStringForIDs := "[]*UUID{" - for _, f := range this.IDs { - repeatedStringForIDs += strings.Replace(fmt.Sprintf("%v", f), "UUID", "uuidpb.UUID", 1) + "," + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovService(uint64(l)) } - repeatedStringForIDs += "}" - s := strings.Join([]string{`&GetTracepointInfoRequest{`, - `IDs:` + repeatedStringForIDs + `,`, - `}`, - }, "") - return s + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n } -func (this *GetTracepointInfoResponse) String() string { - if this == nil { - return "nil" + +func (m *GetFileSourceInfoRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForTracepoints := "[]*GetTracepointInfoResponse_TracepointState{" - for _, f := range this.Tracepoints { - repeatedStringForTracepoints += strings.Replace(fmt.Sprintf("%v", f), "GetTracepointInfoResponse_TracepointState", "GetTracepointInfoResponse_TracepointState", 1) + "," + var l int + _ = l + if len(m.IDs) > 0 { + for _, e := range m.IDs { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - repeatedStringForTracepoints += "}" - s := strings.Join([]string{`&GetTracepointInfoResponse{`, - `Tracepoints:` + repeatedStringForTracepoints + `,`, - `}`, - }, "") - return s + return n } -func (this *GetTracepointInfoResponse_TracepointState) String() string { - if this == nil { - return "nil" + +func (m *GetFileSourceInfoResponse) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForStatuses := "[]*Status{" - for _, f := range this.Statuses { - repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "Status", "statuspb.Status", 1) + "," + var l int + _ = l + if len(m.FileSources) > 0 { + for _, e := range m.FileSources { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - repeatedStringForStatuses += "}" - s := strings.Join([]string{`&GetTracepointInfoResponse_TracepointState{`, - `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Statuses:` + repeatedStringForStatuses + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ExpectedState:` + fmt.Sprintf("%v", this.ExpectedState) + `,`, - `SchemaNames:` + fmt.Sprintf("%v", this.SchemaNames) + `,`, - `}`, - }, "") - return s + return n } -func (this *RemoveTracepointRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RemoveTracepointRequest{`, - `Names:` + fmt.Sprintf("%v", this.Names) + `,`, - `}`, - }, "") - return s -} -func (this *RemoveTracepointResponse) String() string { - if this == nil { - return "nil" + +func (m *GetFileSourceInfoResponse_FileSourceState) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&RemoveTracepointResponse{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateConfigRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovService(uint64(l)) } - s := strings.Join([]string{`&UpdateConfigRequest{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `AgentPodName:` + fmt.Sprintf("%v", this.AgentPodName) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateConfigResponse) String() string { - if this == nil { - return "nil" + if m.State != 0 { + n += 1 + sovService(uint64(m.State)) } - s := strings.Join([]string{`&UpdateConfigResponse{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, - `}`, - }, "") - return s -} -func (this *GetScriptsRequest) String() string { - if this == nil { - return "nil" + if len(m.Statuses) > 0 { + for _, e := range m.Statuses { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - s := strings.Join([]string{`&GetScriptsRequest{`, - `}`, - }, "") - return s -} -func (this *GetScriptsResponse) String() string { - if this == nil { - return "nil" + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - keysForScripts := make([]string, 0, len(this.Scripts)) - for k, _ := range this.Scripts { - keysForScripts = append(keysForScripts, k) + if m.ExpectedState != 0 { + n += 1 + sovService(uint64(m.ExpectedState)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) - mapStringForScripts := "map[string]*cvmsgspb.CronScript{" - for _, k := range keysForScripts { - mapStringForScripts += fmt.Sprintf("%v: %v,", k, this.Scripts[k]) + if len(m.SchemaNames) > 0 { + for _, s := range m.SchemaNames { + l = len(s) + n += 1 + l + sovService(uint64(l)) + } } - mapStringForScripts += "}" - s := strings.Join([]string{`&GetScriptsResponse{`, - `Scripts:` + mapStringForScripts + `,`, - `}`, - }, "") - return s + return n } -func (this *AddOrUpdateScriptRequest) String() string { - if this == nil { - return "nil" + +func (m *RemoveFileSourceRequest) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&AddOrUpdateScriptRequest{`, - `Script:` + strings.Replace(fmt.Sprintf("%v", this.Script), "CronScript", "cvmsgspb.CronScript", 1) + `,`, - `}`, - }, "") - return s -} -func (this *AddOrUpdateScriptResponse) String() string { - if this == nil { - return "nil" + var l int + _ = l + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sovService(uint64(l)) + } } - s := strings.Join([]string{`&AddOrUpdateScriptResponse{`, - `}`, - }, "") - return s + return n } -func (this *DeleteScriptRequest) String() string { - if this == nil { - return "nil" + +func (m *RemoveFileSourceResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&DeleteScriptRequest{`, - `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, - `}`, - }, "") - return s + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) + } + return n } -func (this *DeleteScriptResponse) String() string { - if this == nil { - return "nil" + +func (m *RegisterTracepointRequest) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&DeleteScriptResponse{`, - `}`, - }, "") - return s + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n } -func (this *SetScriptsRequest) String() string { - if this == nil { - return "nil" + +func (m *RegisterTracepointRequest_TracepointRequest) Size() (n int) { + if m == nil { + return 0 } - keysForScripts := make([]string, 0, len(this.Scripts)) - for k, _ := range this.Scripts { - keysForScripts = append(keysForScripts, k) + var l int + _ = l + if m.TracepointDeployment != nil { + l = m.TracepointDeployment.Size() + n += 1 + l + sovService(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) - mapStringForScripts := "map[string]*cvmsgspb.CronScript{" - for _, k := range keysForScripts { - mapStringForScripts += fmt.Sprintf("%v: %v,", k, this.Scripts[k]) + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) } - mapStringForScripts += "}" - s := strings.Join([]string{`&SetScriptsRequest{`, - `Scripts:` + mapStringForScripts + `,`, - `}`, - }, "") - return s -} -func (this *SetScriptsResponse) String() string { - if this == nil { - return "nil" + if m.TTL != nil { + l = m.TTL.Size() + n += 1 + l + sovService(uint64(l)) } - s := strings.Join([]string{`&SetScriptsResponse{`, - `}`, - }, "") - return s + return n } -func (this *ExecutionStats) String() string { - if this == nil { - return "nil" + +func (m *RegisterTracepointResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&ExecutionStats{`, - `ExecutionTimeNs:` + fmt.Sprintf("%v", this.ExecutionTimeNs) + `,`, - `CompilationTimeNs:` + fmt.Sprintf("%v", this.CompilationTimeNs) + `,`, - `BytesProcessed:` + fmt.Sprintf("%v", this.BytesProcessed) + `,`, - `RecordsProcessed:` + fmt.Sprintf("%v", this.RecordsProcessed) + `,`, - `}`, - }, "") - return s -} -func (this *RecordExecutionResultRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if len(m.Tracepoints) > 0 { + for _, e := range m.Tracepoints { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } } - s := strings.Join([]string{`&RecordExecutionResultRequest{`, - `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, - `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `}`, - }, "") - return s -} -func (this *RecordExecutionResultRequest_Error) String() string { - if this == nil { - return "nil" + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) } - s := strings.Join([]string{`&RecordExecutionResultRequest_Error{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Status", "statuspb.Status", 1) + `,`, - `}`, - }, "") - return s + return n } -func (this *RecordExecutionResultRequest_ExecutionStats) String() string { - if this == nil { - return "nil" + +func (m *RegisterTracepointResponse_TracepointStatus) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&RecordExecutionResultRequest_ExecutionStats{`, - `ExecutionStats:` + strings.Replace(fmt.Sprintf("%v", this.ExecutionStats), "ExecutionStats", "ExecutionStats", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RecordExecutionResultResponse) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *GetTracepointInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IDs) > 0 { + for _, e := range m.IDs { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *GetTracepointInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Tracepoints) > 0 { + for _, e := range m.Tracepoints { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *GetTracepointInfoResponse_TracepointState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.State != 0 { + n += 1 + sovService(uint64(m.State)) + } + if len(m.Statuses) > 0 { + for _, e := range m.Statuses { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + if m.ExpectedState != 0 { + n += 1 + sovService(uint64(m.ExpectedState)) + } + if len(m.SchemaNames) > 0 { + for _, s := range m.SchemaNames { + l = len(s) + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *RemoveTracepointRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *RemoveTracepointResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *UpdateConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.AgentPodName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *UpdateConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *GetScriptsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetScriptsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Scripts) > 0 { + for k, v := range m.Scripts { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovService(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + l + n += mapEntrySize + 1 + sovService(uint64(mapEntrySize)) + } + } + return n +} + +func (m *AddOrUpdateScriptRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Script != nil { + l = m.Script.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *AddOrUpdateScriptResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *DeleteScriptRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != nil { + l = m.ScriptID.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *DeleteScriptResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SetScriptsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Scripts) > 0 { + for k, v := range m.Scripts { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovService(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovService(uint64(len(k))) + l + n += mapEntrySize + 1 + sovService(uint64(mapEntrySize)) + } + } + return n +} + +func (m *SetScriptsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ExecutionStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExecutionTimeNs != 0 { + n += 1 + sovService(uint64(m.ExecutionTimeNs)) + } + if m.CompilationTimeNs != 0 { + n += 1 + sovService(uint64(m.CompilationTimeNs)) + } + if m.BytesProcessed != 0 { + n += 1 + sovService(uint64(m.BytesProcessed)) + } + if m.RecordsProcessed != 0 { + n += 1 + sovService(uint64(m.RecordsProcessed)) + } + return n +} + +func (m *RecordExecutionResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != nil { + l = m.ScriptID.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.Result != nil { + n += m.Result.Size() + } + return n +} + +func (m *RecordExecutionResultRequest_Error) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Error != nil { + l = m.Error.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} +func (m *RecordExecutionResultRequest_ExecutionStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExecutionStats != nil { + l = m.ExecutionStats.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} +func (m *RecordExecutionResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetAllExecutionResultsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetAllExecutionResultsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ScriptID != nil { + l = m.ScriptID.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovService(uint64(l)) + } + if m.Result != nil { + n += m.Result.Size() + } + return n +} + +func (m *GetAllExecutionResultsResponse_ExecutionResult_Error) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Error != nil { + l = m.Error.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} +func (m *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExecutionStats != nil { + l = m.ExecutionStats.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *SchemaRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchemaRequest{`, + `}`, + }, "") + return s +} +func (this *SchemaResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchemaResponse{`, + `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "Schema", "schemapb.Schema", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AgentInfoRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentInfoRequest{`, + `}`, + }, "") + return s +} +func (this *AgentInfoResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForInfo := "[]*AgentMetadata{" + for _, f := range this.Info { + repeatedStringForInfo += strings.Replace(f.String(), "AgentMetadata", "AgentMetadata", 1) + "," + } + repeatedStringForInfo += "}" + s := strings.Join([]string{`&AgentInfoResponse{`, + `Info:` + repeatedStringForInfo + `,`, + `}`, + }, "") + return s +} +func (this *AgentMetadata) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentMetadata{`, + `Agent:` + strings.Replace(fmt.Sprintf("%v", this.Agent), "Agent", "agentpb.Agent", 1) + `,`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "AgentStatus", "agentpb.AgentStatus", 1) + `,`, + `CarnotInfo:` + strings.Replace(fmt.Sprintf("%v", this.CarnotInfo), "CarnotInfo", "distributedpb.CarnotInfo", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdatesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentUpdatesRequest{`, + `MaxUpdateInterval:` + strings.Replace(fmt.Sprintf("%v", this.MaxUpdateInterval), "Duration", "types.Duration", 1) + `,`, + `MaxUpdatesPerResponse:` + fmt.Sprintf("%v", this.MaxUpdatesPerResponse) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdate) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentUpdate{`, + `AgentID:` + strings.Replace(fmt.Sprintf("%v", this.AgentID), "UUID", "uuidpb.UUID", 1) + `,`, + `Update:` + fmt.Sprintf("%v", this.Update) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdate_Deleted) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentUpdate_Deleted{`, + `Deleted:` + fmt.Sprintf("%v", this.Deleted) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdate_Agent) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentUpdate_Agent{`, + `Agent:` + strings.Replace(fmt.Sprintf("%v", this.Agent), "Agent", "agentpb.Agent", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdate_DataInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentUpdate_DataInfo{`, + `DataInfo:` + strings.Replace(fmt.Sprintf("%v", this.DataInfo), "AgentDataInfo", "messagespb.AgentDataInfo", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AgentUpdatesResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForAgentUpdates := "[]*AgentUpdate{" + for _, f := range this.AgentUpdates { + repeatedStringForAgentUpdates += strings.Replace(f.String(), "AgentUpdate", "AgentUpdate", 1) + "," + } + repeatedStringForAgentUpdates += "}" + repeatedStringForAgentSchemas := "[]*SchemaInfo{" + for _, f := range this.AgentSchemas { + repeatedStringForAgentSchemas += strings.Replace(fmt.Sprintf("%v", f), "SchemaInfo", "distributedpb.SchemaInfo", 1) + "," + } + repeatedStringForAgentSchemas += "}" + s := strings.Join([]string{`&AgentUpdatesResponse{`, + `AgentUpdates:` + repeatedStringForAgentUpdates + `,`, + `AgentSchemas:` + repeatedStringForAgentSchemas + `,`, + `AgentSchemasUpdated:` + fmt.Sprintf("%v", this.AgentSchemasUpdated) + `,`, + `EndOfVersion:` + fmt.Sprintf("%v", this.EndOfVersion) + `,`, + `}`, + }, "") + return s +} +func (this *WithPrefixKeyRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WithPrefixKeyRequest{`, + `Prefix:` + fmt.Sprintf("%v", this.Prefix) + `,`, + `Proto:` + fmt.Sprintf("%v", this.Proto) + `,`, + `}`, + }, "") + return s +} +func (this *WithPrefixKeyResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForKvs := "[]*WithPrefixKeyResponse_KV{" + for _, f := range this.Kvs { + repeatedStringForKvs += strings.Replace(fmt.Sprintf("%v", f), "WithPrefixKeyResponse_KV", "WithPrefixKeyResponse_KV", 1) + "," + } + repeatedStringForKvs += "}" + s := strings.Join([]string{`&WithPrefixKeyResponse{`, + `Kvs:` + repeatedStringForKvs + `,`, + `}`, + }, "") + return s +} +func (this *WithPrefixKeyResponse_KV) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WithPrefixKeyResponse_KV{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *RegisterFileSourceRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForRequests := "[]*FileSourceDeployment{" + for _, f := range this.Requests { + repeatedStringForRequests += strings.Replace(fmt.Sprintf("%v", f), "FileSourceDeployment", "ir.FileSourceDeployment", 1) + "," + } + repeatedStringForRequests += "}" + s := strings.Join([]string{`&RegisterFileSourceRequest{`, + `Requests:` + repeatedStringForRequests + `,`, + `}`, + }, "") + return s +} +func (this *RegisterFileSourceResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForFileSources := "[]*RegisterFileSourceResponse_FileSourceStatus{" + for _, f := range this.FileSources { + repeatedStringForFileSources += strings.Replace(fmt.Sprintf("%v", f), "RegisterFileSourceResponse_FileSourceStatus", "RegisterFileSourceResponse_FileSourceStatus", 1) + "," + } + repeatedStringForFileSources += "}" + s := strings.Join([]string{`&RegisterFileSourceResponse{`, + `FileSources:` + repeatedStringForFileSources + `,`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RegisterFileSourceResponse_FileSourceStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RegisterFileSourceResponse_FileSourceStatus{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *GetFileSourceInfoRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForIDs := "[]*UUID{" + for _, f := range this.IDs { + repeatedStringForIDs += strings.Replace(fmt.Sprintf("%v", f), "UUID", "uuidpb.UUID", 1) + "," + } + repeatedStringForIDs += "}" + s := strings.Join([]string{`&GetFileSourceInfoRequest{`, + `IDs:` + repeatedStringForIDs + `,`, + `}`, + }, "") + return s +} +func (this *GetFileSourceInfoResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForFileSources := "[]*GetFileSourceInfoResponse_FileSourceState{" + for _, f := range this.FileSources { + repeatedStringForFileSources += strings.Replace(fmt.Sprintf("%v", f), "GetFileSourceInfoResponse_FileSourceState", "GetFileSourceInfoResponse_FileSourceState", 1) + "," + } + repeatedStringForFileSources += "}" + s := strings.Join([]string{`&GetFileSourceInfoResponse{`, + `FileSources:` + repeatedStringForFileSources + `,`, + `}`, + }, "") + return s +} +func (this *GetFileSourceInfoResponse_FileSourceState) String() string { + if this == nil { + return "nil" + } + repeatedStringForStatuses := "[]*Status{" + for _, f := range this.Statuses { + repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "Status", "statuspb.Status", 1) + "," + } + repeatedStringForStatuses += "}" + s := strings.Join([]string{`&GetFileSourceInfoResponse_FileSourceState{`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Statuses:` + repeatedStringForStatuses + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ExpectedState:` + fmt.Sprintf("%v", this.ExpectedState) + `,`, + `SchemaNames:` + fmt.Sprintf("%v", this.SchemaNames) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveFileSourceRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveFileSourceRequest{`, + `Names:` + fmt.Sprintf("%v", this.Names) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveFileSourceResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveFileSourceResponse{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RegisterTracepointRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForRequests := "[]*RegisterTracepointRequest_TracepointRequest{" + for _, f := range this.Requests { + repeatedStringForRequests += strings.Replace(fmt.Sprintf("%v", f), "RegisterTracepointRequest_TracepointRequest", "RegisterTracepointRequest_TracepointRequest", 1) + "," + } + repeatedStringForRequests += "}" + s := strings.Join([]string{`&RegisterTracepointRequest{`, + `Requests:` + repeatedStringForRequests + `,`, + `}`, + }, "") + return s +} +func (this *RegisterTracepointRequest_TracepointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RegisterTracepointRequest_TracepointRequest{`, + `TracepointDeployment:` + strings.Replace(fmt.Sprintf("%v", this.TracepointDeployment), "TracepointDeployment", "logicalpb.TracepointDeployment", 1) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `TTL:` + strings.Replace(fmt.Sprintf("%v", this.TTL), "Duration", "types.Duration", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RegisterTracepointResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForTracepoints := "[]*RegisterTracepointResponse_TracepointStatus{" + for _, f := range this.Tracepoints { + repeatedStringForTracepoints += strings.Replace(fmt.Sprintf("%v", f), "RegisterTracepointResponse_TracepointStatus", "RegisterTracepointResponse_TracepointStatus", 1) + "," + } + repeatedStringForTracepoints += "}" + s := strings.Join([]string{`&RegisterTracepointResponse{`, + `Tracepoints:` + repeatedStringForTracepoints + `,`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RegisterTracepointResponse_TracepointStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RegisterTracepointResponse_TracepointStatus{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *GetTracepointInfoRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForIDs := "[]*UUID{" + for _, f := range this.IDs { + repeatedStringForIDs += strings.Replace(fmt.Sprintf("%v", f), "UUID", "uuidpb.UUID", 1) + "," + } + repeatedStringForIDs += "}" + s := strings.Join([]string{`&GetTracepointInfoRequest{`, + `IDs:` + repeatedStringForIDs + `,`, + `}`, + }, "") + return s +} +func (this *GetTracepointInfoResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForTracepoints := "[]*GetTracepointInfoResponse_TracepointState{" + for _, f := range this.Tracepoints { + repeatedStringForTracepoints += strings.Replace(fmt.Sprintf("%v", f), "GetTracepointInfoResponse_TracepointState", "GetTracepointInfoResponse_TracepointState", 1) + "," + } + repeatedStringForTracepoints += "}" + s := strings.Join([]string{`&GetTracepointInfoResponse{`, + `Tracepoints:` + repeatedStringForTracepoints + `,`, + `}`, + }, "") + return s +} +func (this *GetTracepointInfoResponse_TracepointState) String() string { + if this == nil { + return "nil" + } + repeatedStringForStatuses := "[]*Status{" + for _, f := range this.Statuses { + repeatedStringForStatuses += strings.Replace(fmt.Sprintf("%v", f), "Status", "statuspb.Status", 1) + "," + } + repeatedStringForStatuses += "}" + s := strings.Join([]string{`&GetTracepointInfoResponse_TracepointState{`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Statuses:` + repeatedStringForStatuses + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ExpectedState:` + fmt.Sprintf("%v", this.ExpectedState) + `,`, + `SchemaNames:` + fmt.Sprintf("%v", this.SchemaNames) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveTracepointRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveTracepointRequest{`, + `Names:` + fmt.Sprintf("%v", this.Names) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveTracepointResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveTracepointResponse{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *UpdateConfigRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdateConfigRequest{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `AgentPodName:` + fmt.Sprintf("%v", this.AgentPodName) + `,`, + `}`, + }, "") + return s +} +func (this *UpdateConfigResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdateConfigResponse{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GetScriptsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetScriptsRequest{`, + `}`, + }, "") + return s +} +func (this *GetScriptsResponse) String() string { + if this == nil { + return "nil" + } + keysForScripts := make([]string, 0, len(this.Scripts)) + for k, _ := range this.Scripts { + keysForScripts = append(keysForScripts, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) + mapStringForScripts := "map[string]*cvmsgspb.CronScript{" + for _, k := range keysForScripts { + mapStringForScripts += fmt.Sprintf("%v: %v,", k, this.Scripts[k]) + } + mapStringForScripts += "}" + s := strings.Join([]string{`&GetScriptsResponse{`, + `Scripts:` + mapStringForScripts + `,`, + `}`, + }, "") + return s +} +func (this *AddOrUpdateScriptRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddOrUpdateScriptRequest{`, + `Script:` + strings.Replace(fmt.Sprintf("%v", this.Script), "CronScript", "cvmsgspb.CronScript", 1) + `,`, + `}`, + }, "") + return s +} +func (this *AddOrUpdateScriptResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AddOrUpdateScriptResponse{`, + `}`, + }, "") + return s +} +func (this *DeleteScriptRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteScriptRequest{`, + `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteScriptResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteScriptResponse{`, + `}`, + }, "") + return s +} +func (this *SetScriptsRequest) String() string { + if this == nil { + return "nil" + } + keysForScripts := make([]string, 0, len(this.Scripts)) + for k, _ := range this.Scripts { + keysForScripts = append(keysForScripts, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForScripts) + mapStringForScripts := "map[string]*cvmsgspb.CronScript{" + for _, k := range keysForScripts { + mapStringForScripts += fmt.Sprintf("%v: %v,", k, this.Scripts[k]) + } + mapStringForScripts += "}" + s := strings.Join([]string{`&SetScriptsRequest{`, + `Scripts:` + mapStringForScripts + `,`, + `}`, + }, "") + return s +} +func (this *SetScriptsResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SetScriptsResponse{`, + `}`, + }, "") + return s +} +func (this *ExecutionStats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExecutionStats{`, + `ExecutionTimeNs:` + fmt.Sprintf("%v", this.ExecutionTimeNs) + `,`, + `CompilationTimeNs:` + fmt.Sprintf("%v", this.CompilationTimeNs) + `,`, + `BytesProcessed:` + fmt.Sprintf("%v", this.BytesProcessed) + `,`, + `RecordsProcessed:` + fmt.Sprintf("%v", this.RecordsProcessed) + `,`, + `}`, + }, "") + return s +} +func (this *RecordExecutionResultRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RecordExecutionResultRequest{`, + `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, + `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, + `Result:` + fmt.Sprintf("%v", this.Result) + `,`, + `}`, + }, "") + return s +} +func (this *RecordExecutionResultRequest_Error) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RecordExecutionResultRequest_Error{`, + `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RecordExecutionResultRequest_ExecutionStats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RecordExecutionResultRequest_ExecutionStats{`, + `ExecutionStats:` + strings.Replace(fmt.Sprintf("%v", this.ExecutionStats), "ExecutionStats", "ExecutionStats", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RecordExecutionResultResponse) String() string { + if this == nil { + return "nil" } s := strings.Join([]string{`&RecordExecutionResultResponse{`, `}`, }, "") return s } -func (this *GetAllExecutionResultsRequest) String() string { - if this == nil { - return "nil" +func (this *GetAllExecutionResultsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetAllExecutionResultsRequest{`, + `}`, + }, "") + return s +} +func (this *GetAllExecutionResultsResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForResults := "[]*GetAllExecutionResultsResponse_ExecutionResult{" + for _, f := range this.Results { + repeatedStringForResults += strings.Replace(fmt.Sprintf("%v", f), "GetAllExecutionResultsResponse_ExecutionResult", "GetAllExecutionResultsResponse_ExecutionResult", 1) + "," + } + repeatedStringForResults += "}" + s := strings.Join([]string{`&GetAllExecutionResultsResponse{`, + `Results:` + repeatedStringForResults + `,`, + `}`, + }, "") + return s +} +func (this *GetAllExecutionResultsResponse_ExecutionResult) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult{`, + `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, + `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, + `Result:` + fmt.Sprintf("%v", this.Result) + `,`, + `}`, + }, "") + return s +} +func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult_Error{`, + `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Status", "statuspb.Status", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats{`, + `ExecutionStats:` + strings.Replace(fmt.Sprintf("%v", this.ExecutionStats), "ExecutionStats", "ExecutionStats", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringService(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *SchemaRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchemaRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SchemaResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchemaResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Schema == nil { + m.Schema = &schemapb.Schema{} + } + if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - s := strings.Join([]string{`&GetAllExecutionResultsRequest{`, - `}`, - }, "") - return s + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (this *GetAllExecutionResultsResponse) String() string { - if this == nil { - return "nil" +func (m *AgentInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = append(m.Info, &AgentMetadata{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - repeatedStringForResults := "[]*GetAllExecutionResultsResponse_ExecutionResult{" - for _, f := range this.Results { - repeatedStringForResults += strings.Replace(fmt.Sprintf("%v", f), "GetAllExecutionResultsResponse_ExecutionResult", "GetAllExecutionResultsResponse_ExecutionResult", 1) + "," + + if iNdEx > l { + return io.ErrUnexpectedEOF } - repeatedStringForResults += "}" - s := strings.Join([]string{`&GetAllExecutionResultsResponse{`, - `Results:` + repeatedStringForResults + `,`, - `}`, - }, "") - return s + return nil } -func (this *GetAllExecutionResultsResponse_ExecutionResult) String() string { - if this == nil { - return "nil" +func (m *AgentMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Agent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Agent == nil { + m.Agent = &agentpb.Agent{} + } + if err := m.Agent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &agentpb.AgentStatus{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CarnotInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CarnotInfo == nil { + m.CarnotInfo = &distributedpb.CarnotInfo{} + } + if err := m.CarnotInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult{`, - `ScriptID:` + strings.Replace(fmt.Sprintf("%v", this.ScriptID), "UUID", "uuidpb.UUID", 1) + `,`, - `Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `}`, - }, "") - return s -} -func (this *GetAllExecutionResultsResponse_ExecutionResult_Error) String() string { - if this == nil { - return "nil" + + if iNdEx > l { + return io.ErrUnexpectedEOF } - s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult_Error{`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Status", "statuspb.Status", 1) + `,`, - `}`, - }, "") - return s + return nil } -func (this *GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats) String() string { - if this == nil { - return "nil" +func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentUpdatesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentUpdatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUpdateInterval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxUpdateInterval == nil { + m.MaxUpdateInterval = &types.Duration{} + } + if err := m.MaxUpdateInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxUpdatesPerResponse", wireType) + } + m.MaxUpdatesPerResponse = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxUpdatesPerResponse |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - s := strings.Join([]string{`&GetAllExecutionResultsResponse_ExecutionResult_ExecutionStats{`, - `ExecutionStats:` + strings.Replace(fmt.Sprintf("%v", this.ExecutionStats), "ExecutionStats", "ExecutionStats", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringService(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + + if iNdEx > l { + return io.ErrUnexpectedEOF } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return nil } -func (m *SchemaRequest) Unmarshal(dAtA []byte) error { +func (m *AgentUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7260,25 +9345,152 @@ func (m *SchemaRequest) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowService } - if iNdEx >= l { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentID == nil { + m.AgentID = &uuidpb.UUID{} + } + if err := m.AgentID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Update = &AgentUpdate_Deleted{b} + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Agent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + v := &agentpb.Agent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SchemaRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.Update = &AgentUpdate_Agent{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &messagespb.AgentDataInfo{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Update = &AgentUpdate_DataInfo{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) @@ -7300,7 +9512,7 @@ func (m *SchemaRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *SchemaResponse) Unmarshal(dAtA []byte) error { +func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7323,15 +9535,15 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SchemaResponse: wiretype end group for non-group") + return fmt.Errorf("proto: AgentUpdatesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AgentUpdatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AgentUpdates", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7358,13 +9570,85 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Schema == nil { - m.Schema = &schemapb.Schema{} + m.AgentUpdates = append(m.AgentUpdates, &AgentUpdate{}) + if err := m.AgentUpdates[len(m.AgentUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentSchemas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentSchemas = append(m.AgentSchemas, &distributedpb.SchemaInfo{}) + if err := m.AgentSchemas[len(m.AgentSchemas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentSchemasUpdated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AgentSchemasUpdated = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndOfVersion", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EndOfVersion = bool(v != 0) default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) @@ -7386,7 +9670,7 @@ func (m *SchemaResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentInfoRequest) Unmarshal(dAtA []byte) error { +func (m *WithPrefixKeyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7396,25 +9680,89 @@ func (m *AgentInfoRequest) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowService } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WithPrefixKeyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WithPrefixKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proto", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if postIndex > l { + return io.ErrUnexpectedEOF } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AgentInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AgentInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.Proto = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) @@ -7436,7 +9784,7 @@ func (m *AgentInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentInfoResponse) Unmarshal(dAtA []byte) error { +func (m *WithPrefixKeyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7459,15 +9807,15 @@ func (m *AgentInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: WithPrefixKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WithPrefixKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7494,8 +9842,8 @@ func (m *AgentInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = append(m.Info, &AgentMetadata{}) - if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Kvs = append(m.Kvs, &WithPrefixKeyResponse_KV{}) + if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7520,7 +9868,7 @@ func (m *AgentInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentMetadata) Unmarshal(dAtA []byte) error { +func (m *WithPrefixKeyResponse_KV) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7543,17 +9891,17 @@ func (m *AgentMetadata) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentMetadata: wiretype end group for non-group") + return fmt.Errorf("proto: KV: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KV: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Agent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -7563,33 +9911,29 @@ func (m *AgentMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Agent == nil { - m.Agent = &agentpb.Agent{} - } - if err := m.Agent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -7599,31 +9943,79 @@ func (m *AgentMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &agentpb.AgentStatus{} + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 3: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisterFileSourceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegisterFileSourceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterFileSourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CarnotInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7650,10 +10042,8 @@ func (m *AgentMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CarnotInfo == nil { - m.CarnotInfo = &distributedpb.CarnotInfo{} - } - if err := m.CarnotInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Requests = append(m.Requests, &ir.FileSourceDeployment{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7678,7 +10068,7 @@ func (m *AgentMetadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { +func (m *RegisterFileSourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7701,15 +10091,15 @@ func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentUpdatesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RegisterFileSourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentUpdatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RegisterFileSourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxUpdateInterval", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileSources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7736,18 +10126,16 @@ func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.MaxUpdateInterval == nil { - m.MaxUpdateInterval = &types.Duration{} - } - if err := m.MaxUpdateInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.FileSources = append(m.FileSources, &RegisterFileSourceResponse_FileSourceStatus{}) + if err := m.FileSources[len(m.FileSources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxUpdatesPerResponse", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - m.MaxUpdatesPerResponse = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -7757,11 +10145,28 @@ func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxUpdatesPerResponse |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &statuspb.Status{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) @@ -7783,7 +10188,7 @@ func (m *AgentUpdatesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentUpdate) Unmarshal(dAtA []byte) error { +func (m *RegisterFileSourceResponse_FileSourceStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7806,15 +10211,15 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentUpdate: wiretype end group for non-group") + return fmt.Errorf("proto: FileSourceStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FileSourceStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7841,18 +10246,18 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AgentID == nil { - m.AgentID = &uuidpb.UUID{} + if m.Status == nil { + m.Status = &statuspb.Status{} } - if err := m.AgentID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -7862,18 +10267,33 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.Update = &AgentUpdate_Deleted{b} + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Agent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -7883,30 +10303,77 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - v := &agentpb.Agent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { return err } - m.Update = &AgentUpdate_Agent{v} - iNdEx = postIndex - case 4: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetFileSourceInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetFileSourceInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetFileSourceInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IDs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7933,11 +10400,10 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &messagespb.AgentDataInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.IDs = append(m.IDs, &uuidpb.UUID{}) + if err := m.IDs[len(m.IDs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Update = &AgentUpdate_DataInfo{v} iNdEx = postIndex default: iNdEx = preIndex @@ -7960,7 +10426,7 @@ func (m *AgentUpdate) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { +func (m *GetFileSourceInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7983,15 +10449,15 @@ func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentUpdatesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetFileSourceInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentUpdatesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetFileSourceInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AgentUpdates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileSources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8018,14 +10484,64 @@ func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AgentUpdates = append(m.AgentUpdates, &AgentUpdate{}) - if err := m.AgentUpdates[len(m.AgentUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.FileSources = append(m.FileSources, &GetFileSourceInfoResponse_FileSourceState{}) + if err := m.FileSources[len(m.FileSources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetFileSourceInfoResponse_FileSourceState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileSourceState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileSourceState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AgentSchemas", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8052,16 +10568,18 @@ func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AgentSchemas = append(m.AgentSchemas, &distributedpb.SchemaInfo{}) - if err := m.AgentSchemas[len(m.AgentSchemas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AgentSchemasUpdated", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var v int + m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -8071,17 +10589,16 @@ func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.State |= statuspb.LifeCycleState(b&0x7F) << shift if b < 0x80 { break } } - m.AgentSchemasUpdated = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndOfVersion", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -8091,65 +10608,29 @@ func (m *AgentUpdatesResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.EndOfVersion = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipService(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthService } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WithPrefixKeyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.Statuses = append(m.Statuses, &statuspb.Status{}) + if err := m.Statuses[len(m.Statuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WithPrefixKeyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WithPrefixKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8177,11 +10658,30 @@ func (m *WithPrefixKeyRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Prefix = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedState", wireType) + } + m.ExpectedState = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedState |= statuspb.LifeCycleState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proto", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SchemaNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8209,7 +10709,7 @@ func (m *WithPrefixKeyRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proto = string(dAtA[iNdEx:postIndex]) + m.SchemaNames = append(m.SchemaNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -8232,7 +10732,7 @@ func (m *WithPrefixKeyRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WithPrefixKeyResponse) Unmarshal(dAtA []byte) error { +func (m *RemoveFileSourceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8255,17 +10755,17 @@ func (m *WithPrefixKeyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WithPrefixKeyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveFileSourceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WithPrefixKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveFileSourceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -8275,25 +10775,23 @@ func (m *WithPrefixKeyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - m.Kvs = append(m.Kvs, &WithPrefixKeyResponse_KV{}) - if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -8316,7 +10814,7 @@ func (m *WithPrefixKeyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *WithPrefixKeyResponse_KV) Unmarshal(dAtA []byte) error { +func (m *RemoveFileSourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8339,17 +10837,17 @@ func (m *WithPrefixKeyResponse_KV) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KV: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveFileSourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KV: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveFileSourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowService @@ -8359,56 +10857,26 @@ func (m *WithPrefixKeyResponse_KV) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthService } if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowService - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthService - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthService - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.Status == nil { + m.Status = &statuspb.Status{} } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: diff --git a/src/vizier/services/metadata/metadatapb/service.proto b/src/vizier/services/metadata/metadatapb/service.proto index 7a184c73d15..1b5dd699660 100644 --- a/src/vizier/services/metadata/metadatapb/service.proto +++ b/src/vizier/services/metadata/metadatapb/service.proto @@ -28,6 +28,7 @@ import "google/protobuf/timestamp.proto"; import "src/api/proto/uuidpb/uuid.proto"; import "src/carnot/planner/distributedpb/distributed_plan.proto"; import "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.proto"; +import "src/carnot/planner/file_source/ir/logical.proto"; import "src/common/base/statuspb/status.proto"; import "src/table_store/schemapb/schema.proto"; import "src/vizier/messages/messagespb/messages.proto"; @@ -45,6 +46,12 @@ service MetadataService { rpc GetWithPrefixKey(WithPrefixKeyRequest) returns (WithPrefixKeyResponse); } +service MetadataFileSourceService { + rpc RegisterFileSource(RegisterFileSourceRequest) returns (RegisterFileSourceResponse); + rpc GetFileSourceInfo(GetFileSourceInfoRequest) returns (GetFileSourceInfoResponse); + rpc RemoveFileSource(RemoveFileSourceRequest) returns (RemoveFileSourceResponse); +} + service MetadataTracepointService { rpc RegisterTracepoint(RegisterTracepointRequest) returns (RegisterTracepointResponse); rpc GetTracepointInfo(GetTracepointInfoRequest) returns (GetTracepointInfoResponse); @@ -162,6 +169,63 @@ message WithPrefixKeyResponse { repeated KV kvs = 1; } +message RegisterFileSourceRequest { + repeated px.carnot.planner.file_source.ir.FileSourceDeployment requests = 1; +} + +// The response to a RegisterFileSourceRequest. +message RegisterFileSourceResponse { + message FileSourceStatus { + px.statuspb.Status status = 1; // TODO(ddelnano): Is this necessary? + // The ID of the file source. This should be the user-specified name for the file source . + uuidpb.UUID id = 2 [ (gogoproto.customname) = "ID" ]; + string name = 3; + } + repeated FileSourceStatus file_sources = 1; + // Overall status of whether file source registration requests were initiated with/without + // errors. + px.statuspb.Status status = 2; +} + +// The request to check the status for a file source with the given names. +message GetFileSourceInfoRequest { + // The file source IDs to get the info for. If empty, fetches the info for all known file source + // s. + repeated uuidpb.UUID ids = 1 [ (gogoproto.customname) = "IDs" ]; +} + +// The status of whether the file source has successfully registered or not. +message GetFileSourceInfoResponse { + message FileSourceState { + // The file source ID. + uuidpb.UUID id = 1 [ (gogoproto.customname) = "ID" ]; + // The state of the file source . + px.statuspb.LifeCycleState state = 2; + // The status of the file source, specified if the state of the file source is not healthy. + repeated px.statuspb.Status statuses = 3; + string name = 4; + // The desired state for the file source . This can be used to determine whether + // the file source is just starting up or in the process of terminating. + px.statuspb.LifeCycleState expected_state = 5; + repeated string schema_names = 6; + } + // List of file source states. + repeated FileSourceState file_sources = 1; +} + +// The request to evict a file source . This will normally happen via the file source 's TTL, but +// can be initiated via request as well. +message RemoveFileSourceRequest { + // The name of the file source to remove. + repeated string names = 1; +} + +// The response to the file source removal. +message RemoveFileSourceResponse { + // Status of whether the file source removal request was initiated with/without errors. + px.statuspb.Status status = 1; +} + // The request to register tracepoints on all PEMs. message RegisterTracepointRequest { message TracepointRequest { diff --git a/src/vizier/services/metadata/storepb/BUILD.bazel b/src/vizier/services/metadata/storepb/BUILD.bazel index c2a677a2c8f..f0a1ba5db8d 100644 --- a/src/vizier/services/metadata/storepb/BUILD.bazel +++ b/src/vizier/services/metadata/storepb/BUILD.bazel @@ -23,6 +23,7 @@ pl_proto_library( deps = [ "//src/api/proto/uuidpb:uuid_pl_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_proto", + "//src/carnot/planner/file_source/ir:logical_pl_proto", "//src/common/base/statuspb:status_pl_proto", "//src/shared/k8s/metadatapb:metadata_pl_proto", "//src/shared/types/typespb:types_pl_proto", @@ -37,6 +38,7 @@ pl_cc_proto_library( deps = [ "//src/api/proto/uuidpb:uuid_pl_cc_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_cc_proto", + "//src/carnot/planner/file_source/ir:logical_pl_cc_proto", "//src/common/base/statuspb:status_pl_cc_proto", "//src/shared/k8s/metadatapb:metadata_pl_cc_proto", "//src/shared/types/typespb/wrapper:cc_library", @@ -52,6 +54,7 @@ pl_go_proto_library( deps = [ "//src/api/proto/uuidpb:uuid_pl_go_proto", "//src/carnot/planner/dynamic_tracing/ir/logicalpb:logical_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", "//src/common/base/statuspb:status_pl_go_proto", "//src/shared/k8s/metadatapb:metadata_pl_go_proto", "//src/shared/types/typespb:types_pl_go_proto", diff --git a/src/vizier/services/metadata/storepb/store.pb.go b/src/vizier/services/metadata/storepb/store.pb.go index 17bd3150f69..374e966bab0 100755 --- a/src/vizier/services/metadata/storepb/store.pb.go +++ b/src/vizier/services/metadata/storepb/store.pb.go @@ -14,6 +14,7 @@ import ( math_bits "math/bits" uuidpb "px.dev/pixie/src/api/proto/uuidpb" logicalpb "px.dev/pixie/src/carnot/planner/dynamic_tracing/ir/logicalpb" + ir "px.dev/pixie/src/carnot/planner/file_source/ir" statuspb "px.dev/pixie/src/common/base/statuspb" metadatapb "px.dev/pixie/src/shared/k8s/metadatapb" typespb "px.dev/pixie/src/shared/types/typespb" @@ -99,6 +100,73 @@ func (m *TracepointInfo) GetExpectedState() statuspb.LifeCycleState { return statuspb.UNKNOWN_STATE } +type FileSourceInfo struct { + ID *uuidpb.UUID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + FileSource *ir.FileSourceDeployment `protobuf:"bytes,2,opt,name=file_source,json=fileSource,proto3" json:"file_source,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + ExpectedState statuspb.LifeCycleState `protobuf:"varint,4,opt,name=expected_state,json=expectedState,proto3,enum=px.statuspb.LifeCycleState" json:"expected_state,omitempty"` +} + +func (m *FileSourceInfo) Reset() { *m = FileSourceInfo{} } +func (*FileSourceInfo) ProtoMessage() {} +func (*FileSourceInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_27ea71ea705227d1, []int{1} +} +func (m *FileSourceInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileSourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FileSourceInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FileSourceInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileSourceInfo.Merge(m, src) +} +func (m *FileSourceInfo) XXX_Size() int { + return m.Size() +} +func (m *FileSourceInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FileSourceInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FileSourceInfo proto.InternalMessageInfo + +func (m *FileSourceInfo) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} + +func (m *FileSourceInfo) GetFileSource() *ir.FileSourceDeployment { + if m != nil { + return m.FileSource + } + return nil +} + +func (m *FileSourceInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *FileSourceInfo) GetExpectedState() statuspb.LifeCycleState { + if m != nil { + return m.ExpectedState + } + return statuspb.UNKNOWN_STATE +} + type AgentTracepointStatus struct { State statuspb.LifeCycleState `protobuf:"varint,1,opt,name=state,proto3,enum=px.statuspb.LifeCycleState" json:"state,omitempty"` Status *statuspb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` @@ -109,7 +177,7 @@ type AgentTracepointStatus struct { func (m *AgentTracepointStatus) Reset() { *m = AgentTracepointStatus{} } func (*AgentTracepointStatus) ProtoMessage() {} func (*AgentTracepointStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{1} + return fileDescriptor_27ea71ea705227d1, []int{2} } func (m *AgentTracepointStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -166,6 +234,73 @@ func (m *AgentTracepointStatus) GetAgentID() *uuidpb.UUID { return nil } +type AgentFileSourceStatus struct { + State statuspb.LifeCycleState `protobuf:"varint,1,opt,name=state,proto3,enum=px.statuspb.LifeCycleState" json:"state,omitempty"` + Status *statuspb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + ID *uuidpb.UUID `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + AgentID *uuidpb.UUID `protobuf:"bytes,4,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` +} + +func (m *AgentFileSourceStatus) Reset() { *m = AgentFileSourceStatus{} } +func (*AgentFileSourceStatus) ProtoMessage() {} +func (*AgentFileSourceStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_27ea71ea705227d1, []int{3} +} +func (m *AgentFileSourceStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AgentFileSourceStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AgentFileSourceStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AgentFileSourceStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_AgentFileSourceStatus.Merge(m, src) +} +func (m *AgentFileSourceStatus) XXX_Size() int { + return m.Size() +} +func (m *AgentFileSourceStatus) XXX_DiscardUnknown() { + xxx_messageInfo_AgentFileSourceStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_AgentFileSourceStatus proto.InternalMessageInfo + +func (m *AgentFileSourceStatus) GetState() statuspb.LifeCycleState { + if m != nil { + return m.State + } + return statuspb.UNKNOWN_STATE +} + +func (m *AgentFileSourceStatus) GetStatus() *statuspb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *AgentFileSourceStatus) GetID() *uuidpb.UUID { + if m != nil { + return m.ID + } + return nil +} + +func (m *AgentFileSourceStatus) GetAgentID() *uuidpb.UUID { + if m != nil { + return m.AgentID + } + return nil +} + type TableInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Desc string `protobuf:"bytes,7,opt,name=desc,proto3" json:"desc,omitempty"` @@ -174,12 +309,13 @@ type TableInfo struct { Columns []*TableInfo_ColumnInfo `protobuf:"bytes,4,rep,name=columns,proto3" json:"columns,omitempty"` Tabletized bool `protobuf:"varint,5,opt,name=tabletized,proto3" json:"tabletized,omitempty"` TabletizationKey string `protobuf:"bytes,6,opt,name=tabletization_key,json=tabletizationKey,proto3" json:"tabletization_key,omitempty"` + MutationId string `protobuf:"bytes,8,opt,name=mutation_id,json=mutationId,proto3" json:"mutation_id,omitempty"` } func (m *TableInfo) Reset() { *m = TableInfo{} } func (*TableInfo) ProtoMessage() {} func (*TableInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{2} + return fileDescriptor_27ea71ea705227d1, []int{4} } func (m *TableInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -257,6 +393,13 @@ func (m *TableInfo) GetTabletizationKey() string { return "" } +func (m *TableInfo) GetMutationId() string { + if m != nil { + return m.MutationId + } + return "" +} + type TableInfo_ColumnInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` DataType typespb.DataType `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3,enum=px.types.DataType" json:"data_type,omitempty"` @@ -268,7 +411,7 @@ type TableInfo_ColumnInfo struct { func (m *TableInfo_ColumnInfo) Reset() { *m = TableInfo_ColumnInfo{} } func (*TableInfo_ColumnInfo) ProtoMessage() {} func (*TableInfo_ColumnInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{2, 0} + return fileDescriptor_27ea71ea705227d1, []int{4, 0} } func (m *TableInfo_ColumnInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -340,7 +483,7 @@ type ComputedSchema struct { func (m *ComputedSchema) Reset() { *m = ComputedSchema{} } func (*ComputedSchema) ProtoMessage() {} func (*ComputedSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{3} + return fileDescriptor_27ea71ea705227d1, []int{5} } func (m *ComputedSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -390,7 +533,7 @@ type ComputedSchema_AgentIDs struct { func (m *ComputedSchema_AgentIDs) Reset() { *m = ComputedSchema_AgentIDs{} } func (*ComputedSchema_AgentIDs) ProtoMessage() {} func (*ComputedSchema_AgentIDs) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{3, 0} + return fileDescriptor_27ea71ea705227d1, []int{5, 0} } func (m *ComputedSchema_AgentIDs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -442,7 +585,7 @@ type K8SResource struct { func (m *K8SResource) Reset() { *m = K8SResource{} } func (*K8SResource) ProtoMessage() {} func (*K8SResource) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{4} + return fileDescriptor_27ea71ea705227d1, []int{6} } func (m *K8SResource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -596,7 +739,7 @@ type K8SResourceUpdate struct { func (m *K8SResourceUpdate) Reset() { *m = K8SResourceUpdate{} } func (*K8SResourceUpdate) ProtoMessage() {} func (*K8SResourceUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{5} + return fileDescriptor_27ea71ea705227d1, []int{7} } func (m *K8SResourceUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -645,7 +788,7 @@ type CronScriptResult struct { func (m *CronScriptResult) Reset() { *m = CronScriptResult{} } func (*CronScriptResult) ProtoMessage() {} func (*CronScriptResult) Descriptor() ([]byte, []int) { - return fileDescriptor_27ea71ea705227d1, []int{6} + return fileDescriptor_27ea71ea705227d1, []int{8} } func (m *CronScriptResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +868,9 @@ func (m *CronScriptResult) GetRecordsProcessed() int64 { func init() { proto.RegisterType((*TracepointInfo)(nil), "px.vizier.services.metadata.TracepointInfo") + proto.RegisterType((*FileSourceInfo)(nil), "px.vizier.services.metadata.FileSourceInfo") proto.RegisterType((*AgentTracepointStatus)(nil), "px.vizier.services.metadata.AgentTracepointStatus") + proto.RegisterType((*AgentFileSourceStatus)(nil), "px.vizier.services.metadata.AgentFileSourceStatus") proto.RegisterType((*TableInfo)(nil), "px.vizier.services.metadata.TableInfo") proto.RegisterType((*TableInfo_ColumnInfo)(nil), "px.vizier.services.metadata.TableInfo.ColumnInfo") proto.RegisterType((*ComputedSchema)(nil), "px.vizier.services.metadata.ComputedSchema") @@ -741,87 +886,92 @@ func init() { } var fileDescriptor_27ea71ea705227d1 = []byte{ - // 1273 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xc6, 0x4e, 0x62, 0x3f, 0xb7, 0xf9, 0x33, 0x69, 0xa9, 0x95, 0x8a, 0x75, 0x30, 0x85, - 0xba, 0x54, 0xda, 0xa5, 0xa1, 0x12, 0x51, 0x51, 0xf9, 0x63, 0xbb, 0x10, 0x53, 0x14, 0x55, 0xeb, - 0xe4, 0xc2, 0x65, 0x35, 0xde, 0x9d, 0xba, 0xab, 0x7a, 0x77, 0x46, 0x33, 0xe3, 0x2a, 0xae, 0x38, - 0xf0, 0x11, 0x90, 0xf8, 0x10, 0xc0, 0x91, 0x6f, 0xc1, 0xb1, 0xc7, 0x22, 0xa1, 0x88, 0x6e, 0x85, - 0xc4, 0xb1, 0x17, 0xee, 0x68, 0x66, 0x76, 0xd7, 0x36, 0x6d, 0xd2, 0x72, 0xb1, 0xdf, 0xcc, 0xfc, - 0x7e, 0xbf, 0x79, 0xef, 0xcd, 0x9b, 0x37, 0x0b, 0x1f, 0x0a, 0x1e, 0xb8, 0x8f, 0xa2, 0xc7, 0x11, - 0xe1, 0xae, 0x20, 0xfc, 0x51, 0x14, 0x10, 0xe1, 0xc6, 0x44, 0xe2, 0x10, 0x4b, 0xec, 0x0a, 0x49, - 0x39, 0x61, 0x43, 0xf3, 0xef, 0x30, 0x4e, 0x25, 0x45, 0x97, 0xd9, 0xb1, 0x63, 0x08, 0x4e, 0x4e, - 0x70, 0x72, 0xc2, 0xf6, 0x85, 0x11, 0x1d, 0x51, 0x8d, 0x73, 0x95, 0x65, 0x28, 0xdb, 0xcd, 0x11, - 0xa5, 0xa3, 0x31, 0x71, 0xf5, 0x68, 0x38, 0xb9, 0xef, 0xca, 0x28, 0x26, 0x42, 0xe2, 0x98, 0xe5, - 0x00, 0xe5, 0x05, 0x66, 0x91, 0x41, 0xb8, 0x93, 0x49, 0x14, 0xb2, 0xa1, 0xfe, 0xcb, 0x00, 0xb7, - 0x15, 0x20, 0xc0, 0x3c, 0xa1, 0xd2, 0x65, 0x63, 0x9c, 0x24, 0x84, 0xbb, 0xe1, 0x34, 0xc1, 0x71, - 0x14, 0xf8, 0x92, 0xe3, 0x20, 0x4a, 0x46, 0x6e, 0xc4, 0xdd, 0x31, 0x1d, 0x45, 0x01, 0x1e, 0xb3, - 0x61, 0x6e, 0x65, 0xf4, 0xf7, 0x34, 0x9d, 0xc6, 0x31, 0x4d, 0xdc, 0x21, 0x16, 0xc4, 0x15, 0x12, - 0xcb, 0x89, 0xd0, 0x91, 0x29, 0x23, 0x83, 0xb5, 0x15, 0x4c, 0x3c, 0xc0, 0x9c, 0x84, 0xee, 0xc3, - 0xbd, 0x59, 0x1e, 0xd8, 0xb0, 0x30, 0x33, 0xe4, 0x95, 0x39, 0xa4, 0x9c,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x7e, 0x7d, 0x7a, 0x3f, 0x86, 0x2a, 0x56, 0x1e, 0xfa, 0x51, 0xa8, 0x03, 0x7c, 0x05, - 0xbc, 0x9e, 0x9e, 0x34, 0x57, 0x75, 0x18, 0xfd, 0x9e, 0xb7, 0xaa, 0xd1, 0xfd, 0xb0, 0xf5, 0x6b, - 0x05, 0x6a, 0x87, 0x78, 0x38, 0x26, 0xfa, 0x38, 0xf3, 0x0c, 0x5a, 0x73, 0x19, 0x44, 0x50, 0x09, - 0x89, 0x08, 0x1a, 0xab, 0x66, 0x4e, 0xd9, 0xa8, 0x03, 0x48, 0x48, 0xcc, 0xa5, 0x5f, 0x54, 0xbe, - 0x9f, 0x98, 0x80, 0xca, 0x9d, 0x0b, 0xe9, 0x49, 0x73, 0x63, 0xa0, 0x56, 0x0f, 0xf3, 0xc5, 0x83, - 0x81, 0xb7, 0x21, 0x16, 0x67, 0x04, 0xfa, 0x0c, 0x36, 0x85, 0xa4, 0x6c, 0x51, 0xa2, 0xac, 0x25, - 0xb6, 0xd2, 0x93, 0xe6, 0xfa, 0x40, 0x52, 0x36, 0xaf, 0xb0, 0x2e, 0x16, 0x26, 0x04, 0xba, 0x0b, - 0xab, 0x01, 0x1d, 0x4f, 0xe2, 0x44, 0x34, 0x2a, 0x3b, 0xe5, 0x76, 0x7d, 0xf7, 0x86, 0x73, 0xc6, - 0x5d, 0x76, 0x8a, 0x28, 0x9d, 0xae, 0x66, 0x29, 0xd3, 0xcb, 0x15, 0x90, 0x0d, 0x20, 0x15, 0x40, - 0x46, 0x8f, 0x49, 0xd8, 0x58, 0xde, 0xb1, 0xda, 0x55, 0x6f, 0x6e, 0x06, 0x5d, 0x87, 0xcd, 0x7c, - 0x84, 0x65, 0x44, 0x13, 0xff, 0x21, 0x99, 0x36, 0x56, 0x74, 0x4a, 0x36, 0x16, 0x16, 0xee, 0x92, - 0xe9, 0xf6, 0x1f, 0x16, 0xc0, 0x6c, 0x93, 0x57, 0x66, 0xd5, 0x85, 0x9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67, - 0xd5, 0x9b, 0xc3, 0x49, 0x40, 0x79, 0x38, 0x0f, 0x5d, 0xd5, 0xd0, 0x8d, 0x6c, 0xa1, 0x00, 0x77, - 0x6e, 0x3f, 0x79, 0x66, 0x97, 0x9e, 0x3e, 0xb3, 0x4b, 0x2f, 0x9e, 0xd9, 0xd6, 0xf7, 0xa9, 0x6d, - 0xfd, 0x9c, 0xda, 0xd6, 0x6f, 0xa9, 0x6d, 0x3d, 0x49, 0x6d, 0xeb, 0xcf, 0xd4, 0xb6, 0xfe, 0x4e, - 0xed, 0xd2, 0x8b, 0xd4, 0xb6, 0x7e, 0x78, 0x6e, 0x97, 0x9e, 0x3c, 0xb7, 0x4b, 0x4f, 0x9f, 0xdb, - 0xa5, 0x6f, 0x57, 0xb3, 0x4f, 0xe2, 0xe1, 0x8a, 0x4e, 0xdd, 0x47, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0xbb, 0xe3, 0x37, 0x9a, 0x41, 0x0b, 0x00, 0x00, + // 1352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4d, 0x6f, 0x1b, 0xb7, + 0x16, 0xd5, 0x58, 0xb2, 0x2d, 0x5f, 0x25, 0xfe, 0xa0, 0x93, 0x17, 0xc1, 0xc1, 0x1b, 0xf9, 0xf9, + 0xe5, 0xbd, 0x38, 0x0d, 0x30, 0xd3, 0xb8, 0x41, 0x6b, 0xa4, 0x48, 0x3f, 0x64, 0x25, 0xb5, 0x9a, + 0xc2, 0x08, 0x46, 0x36, 0x0a, 0x74, 0x33, 0xa0, 0x66, 0x68, 0x65, 0x10, 0xcd, 0x90, 0x20, 0xa9, + 0xc0, 0x0a, 0xba, 0xe8, 0x4f, 0x28, 0xd0, 0x1f, 0xd1, 0xf6, 0x9f, 0x74, 0x19, 0x74, 0x95, 0x02, + 0x85, 0xd1, 0x28, 0x28, 0x50, 0x74, 0x95, 0x4d, 0xf7, 0x05, 0xc9, 0xf9, 0x52, 0x63, 0x3b, 0xc9, + 0xa2, 0x9b, 0x6e, 0xac, 0x4b, 0xf2, 0x9c, 0x33, 0x3c, 0x97, 0x77, 0x2e, 0xc7, 0xf0, 0xb6, 0xe0, + 0x81, 0xfb, 0x28, 0x7a, 0x1c, 0x11, 0xee, 0x0a, 0xc2, 0x1f, 0x45, 0x01, 0x11, 0x6e, 0x4c, 0x24, + 0x0e, 0xb1, 0xc4, 0xae, 0x90, 0x94, 0x13, 0xd6, 0x37, 0xbf, 0x0e, 0xe3, 0x54, 0x52, 0x74, 0x99, + 0x1d, 0x39, 0x86, 0xe0, 0x64, 0x04, 0x27, 0x23, 0xac, 0x5d, 0x18, 0xd0, 0x01, 0xd5, 0x38, 0x57, + 0x45, 0x86, 0xb2, 0xd6, 0x1a, 0x50, 0x3a, 0x18, 0x12, 0x57, 0x8f, 0xfa, 0xa3, 0x43, 0x57, 0x46, + 0x31, 0x11, 0x12, 0xc7, 0x2c, 0x03, 0xa8, 0x5d, 0x60, 0x16, 0x19, 0x84, 0x3b, 0x1a, 0x45, 0x21, + 0xeb, 0xeb, 0x9f, 0x14, 0x70, 0x5b, 0x01, 0x02, 0xcc, 0x13, 0x2a, 0x5d, 0x36, 0xc4, 0x49, 0x42, + 0xb8, 0x1b, 0x8e, 0x13, 0x1c, 0x47, 0x81, 0x2f, 0x39, 0x0e, 0xa2, 0x64, 0xe0, 0x46, 0xdc, 0x1d, + 0xd2, 0x41, 0x14, 0xe0, 0x21, 0xeb, 0x67, 0x51, 0x4a, 0x77, 0x4f, 0xa0, 0x1f, 0x46, 0x43, 0xe2, + 0x0b, 0x3a, 0xe2, 0x01, 0x29, 0x51, 0x53, 0xc2, 0xff, 0x34, 0x81, 0xc6, 0x31, 0x4d, 0xdc, 0x3e, + 0x16, 0xc4, 0x15, 0x12, 0xcb, 0x91, 0xd0, 0xa9, 0x50, 0x41, 0x0a, 0xdb, 0x54, 0x30, 0xf1, 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93, 0x5f, + 0x24, 0x5e, 0x01, 0x46, 0xd7, 0x60, 0x96, 0x70, 0x4e, 0x79, 0x5a, 0x7b, 0x27, 0x5e, 0xcd, 0x06, + 0x81, 0xde, 0x82, 0x15, 0x72, 0x44, 0x82, 0x91, 0xee, 0xf1, 0x4a, 0xc1, 0x4f, 0x4c, 0xc5, 0x55, + 0xbd, 0xa5, 0x7c, 0x41, 0x3d, 0x64, 0x4f, 0x20, 0x07, 0x56, 0x03, 0x1a, 0xb3, 0x68, 0x88, 0xa7, + 0xd0, 0xb3, 0x1a, 0xbd, 0x52, 0x5a, 0x4a, 0xf1, 0x57, 0x61, 0xa9, 0x3f, 0x96, 0x44, 0xf8, 0x8c, + 0xd3, 0x80, 0x08, 0x41, 0x42, 0x5d, 0x46, 0x55, 0x6f, 0x51, 0x4f, 0xdf, 0xcf, 0x66, 0xd5, 0xa5, + 0xc4, 0x49, 0x40, 0x79, 0x58, 0x86, 0xce, 0x6b, 0xe8, 0x72, 0xba, 0x90, 0x83, 0xdb, 0xb7, 0x9f, + 0x3c, 0xb3, 0x2b, 0x4f, 0x9f, 0xd9, 0x95, 0x17, 0xcf, 0x6c, 0xeb, 0xab, 0x89, 0x6d, 0x7d, 0x37, + 0xb1, 0xad, 0x1f, 0x26, 0xb6, 0xf5, 0x64, 0x62, 0x5b, 0xbf, 0x4c, 0x6c, 0xeb, 0xb7, 0x89, 0x5d, + 0x79, 0x31, 0xb1, 0xad, 0xaf, 0x9f, 0xdb, 0x95, 0x27, 0xcf, 0xed, 0xca, 0xd3, 0xe7, 0x76, 0xe5, + 0x8b, 0xf9, 0xf4, 0xbf, 0xa5, 0xfe, 0x9c, 0x4e, 0xdd, 0x3b, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, + 0xa4, 0x06, 0x48, 0xe3, 0x5c, 0x0d, 0x00, 0x00, } func (this *TracepointInfo) Equal(that interface{}) bool { @@ -857,6 +1007,39 @@ func (this *TracepointInfo) Equal(that interface{}) bool { } return true } +func (this *FileSourceInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FileSourceInfo) + if !ok { + that2, ok := that.(FileSourceInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + if !this.FileSource.Equal(that1.FileSource) { + return false + } + if this.Name != that1.Name { + return false + } + if this.ExpectedState != that1.ExpectedState { + return false + } + return true +} func (this *AgentTracepointStatus) Equal(that interface{}) bool { if that == nil { return this == nil @@ -890,6 +1073,39 @@ func (this *AgentTracepointStatus) Equal(that interface{}) bool { } return true } +func (this *AgentFileSourceStatus) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*AgentFileSourceStatus) + if !ok { + that2, ok := that.(AgentFileSourceStatus) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.State != that1.State { + return false + } + if !this.Status.Equal(that1.Status) { + return false + } + if !this.ID.Equal(that1.ID) { + return false + } + if !this.AgentID.Equal(that1.AgentID) { + return false + } + return true +} func (this *TableInfo) Equal(that interface{}) bool { if that == nil { return this == nil @@ -935,6 +1151,9 @@ func (this *TableInfo) Equal(that interface{}) bool { if this.TabletizationKey != that1.TabletizationKey { return false } + if this.MutationId != that1.MutationId { + return false + } return true } func (this *TableInfo_ColumnInfo) Equal(that interface{}) bool { @@ -1344,6 +1563,23 @@ func (this *TracepointInfo) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *FileSourceInfo) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&storepb.FileSourceInfo{") + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + if this.FileSource != nil { + s = append(s, "FileSource: "+fmt.Sprintf("%#v", this.FileSource)+",\n") + } + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "ExpectedState: "+fmt.Sprintf("%#v", this.ExpectedState)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} func (this *AgentTracepointStatus) GoString() string { if this == nil { return "nil" @@ -1363,11 +1599,30 @@ func (this *AgentTracepointStatus) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *AgentFileSourceStatus) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&storepb.AgentFileSourceStatus{") + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + if this.ID != nil { + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + } + if this.AgentID != nil { + s = append(s, "AgentID: "+fmt.Sprintf("%#v", this.AgentID)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} func (this *TableInfo) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 11) + s := make([]string, 0, 12) s = append(s, "&storepb.TableInfo{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") @@ -1378,6 +1633,7 @@ func (this *TableInfo) GoString() string { } s = append(s, "Tabletized: "+fmt.Sprintf("%#v", this.Tabletized)+",\n") s = append(s, "TabletizationKey: "+fmt.Sprintf("%#v", this.TabletizationKey)+",\n") + s = append(s, "MutationId: "+fmt.Sprintf("%#v", this.MutationId)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1609,7 +1865,7 @@ func (m *TracepointInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AgentTracepointStatus) Marshal() (dAtA []byte, err error) { +func (m *FileSourceInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1619,31 +1875,31 @@ func (m *AgentTracepointStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AgentTracepointStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *FileSourceInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AgentTracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *FileSourceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AgentID != nil { - { - size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStore(dAtA, i, uint64(size)) - } + if m.ExpectedState != 0 { + i = encodeVarintStore(dAtA, i, uint64(m.ExpectedState)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x20 } - if m.ID != nil { + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintStore(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if m.FileSource != nil { { - size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.FileSource.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1651,11 +1907,11 @@ func (m *AgentTracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintStore(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } - if m.Status != nil { + if m.ID != nil { { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1663,17 +1919,12 @@ func (m *AgentTracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintStore(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if m.State != 0 { - i = encodeVarintStore(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TableInfo) Marshal() (dAtA []byte, err error) { +func (m *AgentTracepointStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1683,25 +1934,160 @@ func (m *TableInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TableInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *AgentTracepointStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TableInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AgentTracepointStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Desc) > 0 { - i -= len(m.Desc) - copy(dAtA[i:], m.Desc) - i = encodeVarintStore(dAtA, i, uint64(len(m.Desc))) - i-- - dAtA[i] = 0x3a - } - if len(m.TabletizationKey) > 0 { - i -= len(m.TabletizationKey) + if m.AgentID != nil { + { + size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.State != 0 { + i = encodeVarintStore(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AgentFileSourceStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AgentFileSourceStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AgentFileSourceStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AgentID != nil { + { + size, err := m.AgentID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ID != nil { + { + size, err := m.ID.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStore(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.State != 0 { + i = encodeVarintStore(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TableInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TableInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TableInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MutationId) > 0 { + i -= len(m.MutationId) + copy(dAtA[i:], m.MutationId) + i = encodeVarintStore(dAtA, i, uint64(len(m.MutationId))) + i-- + dAtA[i] = 0x42 + } + if len(m.Desc) > 0 { + i -= len(m.Desc) + copy(dAtA[i:], m.Desc) + i = encodeVarintStore(dAtA, i, uint64(len(m.Desc))) + i-- + dAtA[i] = 0x3a + } + if len(m.TabletizationKey) > 0 { + i -= len(m.TabletizationKey) copy(dAtA[i:], m.TabletizationKey) i = encodeVarintStore(dAtA, i, uint64(len(m.TabletizationKey))) i-- @@ -2252,6 +2638,30 @@ func (m *TracepointInfo) Size() (n int) { return n } +func (m *FileSourceInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovStore(uint64(l)) + } + if m.FileSource != nil { + l = m.FileSource.Size() + n += 1 + l + sovStore(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovStore(uint64(l)) + } + if m.ExpectedState != 0 { + n += 1 + sovStore(uint64(m.ExpectedState)) + } + return n +} + func (m *AgentTracepointStatus) Size() (n int) { if m == nil { return 0 @@ -2276,6 +2686,30 @@ func (m *AgentTracepointStatus) Size() (n int) { return n } +func (m *AgentFileSourceStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != 0 { + n += 1 + sovStore(uint64(m.State)) + } + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovStore(uint64(l)) + } + if m.ID != nil { + l = m.ID.Size() + n += 1 + l + sovStore(uint64(l)) + } + if m.AgentID != nil { + l = m.AgentID.Size() + n += 1 + l + sovStore(uint64(l)) + } + return n +} + func (m *TableInfo) Size() (n int) { if m == nil { return 0 @@ -2309,6 +2743,10 @@ func (m *TableInfo) Size() (n int) { if l > 0 { n += 1 + l + sovStore(uint64(l)) } + l = len(m.MutationId) + if l > 0 { + n += 1 + l + sovStore(uint64(l)) + } return n } @@ -2554,6 +2992,19 @@ func (this *TracepointInfo) String() string { }, "") return s } +func (this *FileSourceInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FileSourceInfo{`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `FileSource:` + strings.Replace(fmt.Sprintf("%v", this.FileSource), "FileSourceDeployment", "ir.FileSourceDeployment", 1) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ExpectedState:` + fmt.Sprintf("%v", this.ExpectedState) + `,`, + `}`, + }, "") + return s +} func (this *AgentTracepointStatus) String() string { if this == nil { return "nil" @@ -2567,6 +3018,19 @@ func (this *AgentTracepointStatus) String() string { }, "") return s } +func (this *AgentFileSourceStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AgentFileSourceStatus{`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "statuspb.Status", 1) + `,`, + `ID:` + strings.Replace(fmt.Sprintf("%v", this.ID), "UUID", "uuidpb.UUID", 1) + `,`, + `AgentID:` + strings.Replace(fmt.Sprintf("%v", this.AgentID), "UUID", "uuidpb.UUID", 1) + `,`, + `}`, + }, "") + return s +} func (this *TableInfo) String() string { if this == nil { return "nil" @@ -2584,6 +3048,7 @@ func (this *TableInfo) String() string { `Tabletized:` + fmt.Sprintf("%v", this.Tabletized) + `,`, `TabletizationKey:` + fmt.Sprintf("%v", this.TabletizationKey) + `,`, `Desc:` + fmt.Sprintf("%v", this.Desc) + `,`, + `MutationId:` + fmt.Sprintf("%v", this.MutationId) + `,`, `}`, }, "") return s @@ -2940,7 +3405,7 @@ func (m *TracepointInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { +func (m *FileSourceInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2963,34 +3428,15 @@ func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AgentTracepointStatus: wiretype end group for non-group") + return fmt.Errorf("proto: FileSourceInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AgentTracepointStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FileSourceInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStore - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= statuspb.LifeCycleState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3017,16 +3463,16 @@ func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &statuspb.Status{} + if m.ID == nil { + m.ID = &uuidpb.UUID{} } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileSource", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3053,18 +3499,18 @@ func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ID == nil { - m.ID = &uuidpb.UUID{} + if m.FileSource == nil { + m.FileSource = &ir.FileSourceDeployment{} } - if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FileSource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStore @@ -3074,23 +3520,392 @@ func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthStore } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthStore } if postIndex > l { return io.ErrUnexpectedEOF } - if m.AgentID == nil { - m.AgentID = &uuidpb.UUID{} + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedState", wireType) + } + m.ExpectedState = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpectedState |= statuspb.LifeCycleState(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStore(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStore + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentTracepointStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentTracepointStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentTracepointStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= statuspb.LifeCycleState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &statuspb.Status{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentID == nil { + m.AgentID = &uuidpb.UUID{} + } + if err := m.AgentID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStore(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStore + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AgentFileSourceStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AgentFileSourceStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AgentFileSourceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= statuspb.LifeCycleState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &statuspb.Status{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ID == nil { + m.ID = &uuidpb.UUID{} + } + if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentID", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AgentID == nil { + m.AgentID = &uuidpb.UUID{} } if err := m.AgentID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3334,6 +4149,38 @@ func (m *TableInfo) Unmarshal(dAtA []byte) error { } m.Desc = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MutationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStore + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStore + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MutationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStore(dAtA[iNdEx:]) diff --git a/src/vizier/services/metadata/storepb/store.proto b/src/vizier/services/metadata/storepb/store.proto index 975b04d3685..4e1144a497f 100644 --- a/src/vizier/services/metadata/storepb/store.proto +++ b/src/vizier/services/metadata/storepb/store.proto @@ -26,6 +26,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "src/api/proto/uuidpb/uuid.proto"; import "src/carnot/planner/dynamic_tracing/ir/logicalpb/logical.proto"; +import "src/carnot/planner/file_source/ir/logical.proto"; import "src/common/base/statuspb/status.proto"; import "src/shared/k8s/metadatapb/metadata.proto"; import "src/shared/types/typespb/types.proto"; @@ -46,6 +47,18 @@ message TracepointInfo { px.statuspb.LifeCycleState expected_state = 4; } +// Information about the status of a specific file source +message FileSourceInfo { + uuidpb.UUID id = 1 [ (gogoproto.customname) = "ID" ]; + // The file source deployment. + px.carnot.planner.file_source.ir.FileSourceDeployment file_source = 2; + // The name of the file source, not unique. + string name = 3; + // The desired state of the file source, either running or terminated. The actual + // state of the file source is derived by the states of the individual agent file sources. + px.statuspb.LifeCycleState expected_state = 4; +} + // The agent's registration status for a particular tracepoint. message AgentTracepointStatus { // The state of the tracepoint. @@ -56,6 +69,16 @@ message AgentTracepointStatus { uuidpb.UUID agent_id = 4 [ (gogoproto.customname) = "AgentID" ]; } +// The agent's registration status for a particular file source. +message AgentFileSourceStatus { + // The state of the file source. + px.statuspb.LifeCycleState state = 1; + // The status of the file source, specified if the state of the file source is not healthy. + px.statuspb.Status status = 2; + uuidpb.UUID id = 3 [ (gogoproto.customname) = "ID" ]; + uuidpb.UUID agent_id = 4 [ (gogoproto.customname) = "AgentID" ]; +} + // TableInfo contains info about the table in Vizier. message TableInfo { // Name of the table. @@ -83,6 +106,8 @@ message TableInfo { bool tabletized = 5; // The tabletization key of this schema. string tabletization_key = 6; + // ID of the mutation that created this schema, empty if unrelated to a mutation. + string mutation_id = 8; } // ComputedSchema describes the schema available on Vizier. diff --git a/src/vizier/services/query_broker/controllers/BUILD.bazel b/src/vizier/services/query_broker/controllers/BUILD.bazel index 2ccb9f3a1e9..662397ac614 100644 --- a/src/vizier/services/query_broker/controllers/BUILD.bazel +++ b/src/vizier/services/query_broker/controllers/BUILD.bazel @@ -46,6 +46,7 @@ go_library( "//src/carnot/goplanner:go_default_library", "//src/carnot/planner/compilerpb:compiler_status_pl_go_proto", "//src/carnot/planner/distributedpb:distributed_plan_pl_go_proto", + "//src/carnot/planner/file_source/ir:logical_pl_go_proto", "//src/carnot/planner/plannerpb:service_pl_go_proto", "//src/carnot/planpb:plan_pl_go_proto", "//src/carnot/queryresultspb:query_results_pl_go_proto", diff --git a/src/vizier/services/query_broker/controllers/errors.go b/src/vizier/services/query_broker/controllers/errors.go index c07c4eb4f1c..3ce6c74bd1b 100644 --- a/src/vizier/services/query_broker/controllers/errors.go +++ b/src/vizier/services/query_broker/controllers/errors.go @@ -29,4 +29,8 @@ var ( ErrTracepointPending = errors.New("tracepoints are still pending") // ErrConfigUpdateFailed failed to send the config update request to an agent. ErrConfigUpdateFailed = errors.New("failed to update config") + // ErrFileSourceRegistrationFailed failed to register file source. to an agent. + ErrFileSourceRegistrationFailed = errors.New("failed to register file sources") + // ErrFileSourceDeletionFailed failed to delete file source. + ErrFileSourceDeletionFailed = errors.New("failed to delete file sources") ) diff --git a/src/vizier/services/query_broker/controllers/mutation_executor.go b/src/vizier/services/query_broker/controllers/mutation_executor.go index f14ad3028de..abd0e45a267 100644 --- a/src/vizier/services/query_broker/controllers/mutation_executor.go +++ b/src/vizier/services/query_broker/controllers/mutation_executor.go @@ -30,6 +30,7 @@ import ( "px.dev/pixie/src/api/proto/uuidpb" "px.dev/pixie/src/api/proto/vizierpb" "px.dev/pixie/src/carnot/planner/distributedpb" + "px.dev/pixie/src/carnot/planner/file_source/ir" "px.dev/pixie/src/carnot/planner/plannerpb" "px.dev/pixie/src/carnot/planpb" "px.dev/pixie/src/common/base/statuspb" @@ -40,6 +41,7 @@ import ( // TracepointMap stores a map from the name to tracepoint info. type TracepointMap map[string]*TracepointInfo +type FileSourceMap map[string]*FileSourceInfo // MutationExecutor is the interface for running script mutations. type MutationExecutor interface { @@ -51,8 +53,10 @@ type MutationExecutor interface { type MutationExecutorImpl struct { planner Planner mdtp metadatapb.MetadataTracepointServiceClient + mdfs metadatapb.MetadataFileSourceServiceClient mdconf metadatapb.MetadataConfigServiceClient activeTracepoints TracepointMap + activeFileSources FileSourceMap outputTables []string distributedState *distributedpb.DistributedState } @@ -64,19 +68,29 @@ type TracepointInfo struct { Status *statuspb.Status } +type FileSourceInfo struct { + GlobPattern string + TableName string + ID uuid.UUID + Status *statuspb.Status +} + // NewMutationExecutor creates a new mutation executor. func NewMutationExecutor( planner Planner, mdtp metadatapb.MetadataTracepointServiceClient, + mdfs metadatapb.MetadataFileSourceServiceClient, mdconf metadatapb.MetadataConfigServiceClient, distributedState *distributedpb.DistributedState, ) MutationExecutor { return &MutationExecutorImpl{ planner: planner, mdtp: mdtp, + mdfs: mdfs, mdconf: mdconf, distributedState: distributedState, activeTracepoints: make(TracepointMap), + activeFileSources: make(FileSourceMap), } } @@ -87,9 +101,27 @@ func (m *MutationExecutorImpl) Execute(ctx context.Context, req *vizierpb.Execut if err != nil { return nil, err } + var otelConfig *distributedpb.OTelEndpointConfig + if convertedReq.Configs != nil && convertedReq.Configs.OTelEndpointConfig != nil { + otelConfig = &distributedpb.OTelEndpointConfig{ + URL: convertedReq.Configs.OTelEndpointConfig.URL, + Headers: convertedReq.Configs.OTelEndpointConfig.Headers, + Insecure: convertedReq.Configs.OTelEndpointConfig.Insecure, + Timeout: convertedReq.Configs.OTelEndpointConfig.Timeout, + } + } + var pluginConfig *distributedpb.PluginConfig + if req.Configs != nil && req.Configs.PluginConfig != nil { + pluginConfig = &distributedpb.PluginConfig{ + StartTimeNs: req.Configs.PluginConfig.StartTimeNs, + EndTimeNs: req.Configs.PluginConfig.EndTimeNs, + } + } convertedReq.LogicalPlannerState = &distributedpb.LogicalPlannerState{ - DistributedState: m.distributedState, - PlanOptions: planOpts, + DistributedState: m.distributedState, + PlanOptions: planOpts, + OTelEndpointConfig: otelConfig, + PluginConfig: pluginConfig, } mutations, err := m.planner.CompileMutations(convertedReq) @@ -118,6 +150,12 @@ func (m *MutationExecutorImpl) Execute(ctx context.Context, req *vizierpb.Execut Names: make([]string, 0), } configmapReqs := make([]*metadatapb.UpdateConfigRequest, 0) + fileSourceReqs := &metadatapb.RegisterFileSourceRequest{ + Requests: make([]*ir.FileSourceDeployment, 0), + } + deleteFileSourcesReq := &metadatapb.RemoveFileSourceRequest{ + Names: make([]string, 0), + } outputTablesMap := make(map[string]bool) // TODO(zasgar): We should make sure that we don't simultaneously add and delete the tracepoint. @@ -159,6 +197,34 @@ func (m *MutationExecutorImpl) Execute(ctx context.Context, req *vizierpb.Execut AgentPodName: mut.ConfigUpdate.AgentPodName, }) } + case *plannerpb.CompileMutation_FileSource: + { + name := mut.FileSource.GlobPattern + tableName := mut.FileSource.TableName + fileSourceReqs.Requests = append(fileSourceReqs.Requests, &ir.FileSourceDeployment{ + Name: name, + GlobPattern: name, + TableName: tableName, + TTL: mut.FileSource.TTL, + }) + if _, ok := m.activeFileSources[name]; ok { + return nil, fmt.Errorf("file source with name '%s', already used", name) + } + // TODO(ddelnano): Add unit tests that would have caught the bug with the + // file source output table issue. The line that caused the bug is left commented below: + // outputTablesMap[name] = true + outputTablesMap[tableName] = true + + m.activeFileSources[name] = &FileSourceInfo{ + GlobPattern: mut.FileSource.GlobPattern, + ID: uuid.Nil, + Status: nil, + } + } + case *plannerpb.CompileMutation_DeleteFileSource: + { + deleteFileSourcesReq.Names = append(deleteFileSourcesReq.Names, mut.DeleteFileSource.GlobPattern) + } } } @@ -210,6 +276,44 @@ func (m *MutationExecutorImpl) Execute(ctx context.Context, req *vizierpb.Execut } } + if len(fileSourceReqs.Requests) > 0 { + resp, err := m.mdfs.RegisterFileSource(ctx, fileSourceReqs) + if err != nil { + log.WithError(err). + Errorf("Failed to register file sources") + return nil, ErrFileSourceRegistrationFailed + } + if resp.Status != nil && resp.Status.ErrCode != statuspb.OK { + log.WithField("status", resp.Status.String()). + Errorf("Failed to register file sources with bad status") + return resp.Status, ErrFileSourceRegistrationFailed + } + + // Update the internal stat of the file sources. + for _, fs := range resp.FileSources { + id := utils.UUIDFromProtoOrNil(fs.ID) + m.activeFileSources[fs.Name].ID = id + m.activeFileSources[fs.Name].Status = fs.Status + } + } + if len(deleteFileSourcesReq.Names) > 0 { + delResp, err := m.mdfs.RemoveFileSource(ctx, deleteFileSourcesReq) + if err != nil { + log.WithError(err). + Errorf("Failed to delete tracepoints") + return nil, ErrFileSourceDeletionFailed + } + if delResp.Status != nil && delResp.Status.ErrCode != statuspb.OK { + log.WithField("status", delResp.Status.String()). + Errorf("Failed to delete tracepoints with bad status") + return delResp.Status, ErrFileSourceDeletionFailed + } + // Remove the tracepoints we considered deleted. + for _, fsName := range deleteFileSourcesReq.Names { + delete(m.activeFileSources, fsName) + } + } + m.outputTables = make([]string, 0) for k := range outputTablesMap { m.outputTables = append(m.outputTables, k) @@ -220,11 +324,17 @@ func (m *MutationExecutorImpl) Execute(ctx context.Context, req *vizierpb.Execut // MutationInfo returns the summarized mutation information. func (m *MutationExecutorImpl) MutationInfo(ctx context.Context) (*vizierpb.MutationInfo, error) { - req := &metadatapb.GetTracepointInfoRequest{ + tpReq := &metadatapb.GetTracepointInfoRequest{ IDs: make([]*uuidpb.UUID, 0), } for _, tp := range m.activeTracepoints { - req.IDs = append(req.IDs, utils.ProtoFromUUID(tp.ID)) + tpReq.IDs = append(tpReq.IDs, utils.ProtoFromUUID(tp.ID)) + } + fsReq := &metadatapb.GetFileSourceInfoRequest{ + IDs: make([]*uuidpb.UUID, 0), + } + for _, fs := range m.activeFileSources { + fsReq.IDs = append(fsReq.IDs, utils.ProtoFromUUID(fs.ID)) } aCtx, err := authcontext.FromContext(ctx) if err != nil { @@ -232,28 +342,45 @@ func (m *MutationExecutorImpl) MutationInfo(ctx context.Context) (*vizierpb.Muta } ctx = metadata.AppendToOutgoingContext(ctx, "authorization", fmt.Sprintf("bearer %s", aCtx.AuthToken)) - resp, err := m.mdtp.GetTracepointInfo(ctx, req) + tpResp, err := m.mdtp.GetTracepointInfo(ctx, tpReq) if err != nil { return nil, err } + fsResp, err := m.mdfs.GetFileSourceInfo(ctx, fsReq) + if err != nil { + return nil, err + } + tps := len(tpResp.Tracepoints) mutationInfo := &vizierpb.MutationInfo{ Status: &vizierpb.Status{Code: 0}, - States: make([]*vizierpb.MutationInfo_MutationState, len(resp.Tracepoints)), + States: make([]*vizierpb.MutationInfo_MutationState, tps+len(fsResp.FileSources)), } - ready := true - for idx, tp := range resp.Tracepoints { + tpReady := true + for idx, tp := range tpResp.Tracepoints { mutationInfo.States[idx] = &vizierpb.MutationInfo_MutationState{ ID: utils.UUIDFromProtoOrNil(tp.ID).String(), State: convertLifeCycleStateToVizierLifeCycleState(tp.State), Name: tp.Name, } if tp.State != statuspb.RUNNING_STATE { - ready = false + tpReady = false + } + } + + fsReady := true + for idx, fs := range fsResp.FileSources { + mutationInfo.States[idx+tps] = &vizierpb.MutationInfo_MutationState{ + ID: utils.UUIDFromProtoOrNil(fs.ID).String(), + State: convertLifeCycleStateToVizierLifeCycleState(fs.State), + Name: fs.Name, + } + if fs.State != statuspb.RUNNING_STATE { + fsReady = false } } - if !ready { + if !tpReady { mutationInfo.Status = &vizierpb.Status{ Code: int32(codes.Unavailable), Message: "probe installation in progress", @@ -261,6 +388,14 @@ func (m *MutationExecutorImpl) MutationInfo(ctx context.Context) (*vizierpb.Muta return mutationInfo, nil } + if !fsReady { + mutationInfo.Status = &vizierpb.Status{ + Code: int32(codes.Unavailable), + Message: "file source installation in progress", + } + return mutationInfo, nil + } + if !m.isSchemaReady() { mutationInfo.Status = &vizierpb.Status{ Code: int32(codes.Unavailable), diff --git a/src/vizier/services/query_broker/controllers/query_executor.go b/src/vizier/services/query_broker/controllers/query_executor.go index 4d8ff7b7b6b..8897034bcaa 100644 --- a/src/vizier/services/query_broker/controllers/query_executor.go +++ b/src/vizier/services/query_broker/controllers/query_executor.go @@ -89,6 +89,7 @@ type DataPrivacy interface { // MutationExecFactory is a function that creates a new MutationExecutorImpl. type MutationExecFactory func(Planner, metadatapb.MetadataTracepointServiceClient, + metadatapb.MetadataFileSourceServiceClient, metadatapb.MetadataConfigServiceClient, *distributedpb.DistributedState) MutationExecutor @@ -100,6 +101,7 @@ type QueryExecutorImpl struct { dataPrivacy DataPrivacy natsConn *nats.Conn mdtp metadatapb.MetadataTracepointServiceClient + mdfs metadatapb.MetadataFileSourceServiceClient mdconf metadatapb.MetadataConfigServiceClient resultForwarder QueryResultForwarder planner Planner @@ -127,6 +129,7 @@ func NewQueryExecutorFromServer(s *Server, mutExecFactory MutationExecFactory) Q s.dataPrivacy, s.natsConn, s.mdtp, + s.mdfs, s.mdconf, s.resultForwarder, s.planner, @@ -142,6 +145,7 @@ func NewQueryExecutor( dataPrivacy DataPrivacy, natsConn *nats.Conn, mdtp metadatapb.MetadataTracepointServiceClient, + mdfs metadatapb.MetadataFileSourceServiceClient, mdconf metadatapb.MetadataConfigServiceClient, resultForwarder QueryResultForwarder, planner Planner, @@ -154,6 +158,7 @@ func NewQueryExecutor( dataPrivacy: dataPrivacy, natsConn: natsConn, mdtp: mdtp, + mdfs: mdfs, mdconf: mdconf, resultForwarder: resultForwarder, planner: planner, @@ -292,7 +297,7 @@ func (q *QueryExecutorImpl) getPlanOpts(queryStr string) (*planpb.PlanOptions, e } func (q *QueryExecutorImpl) runMutation(ctx context.Context, resultCh chan<- *vizierpb.ExecuteScriptResponse, req *vizierpb.ExecuteScriptRequest, planOpts *planpb.PlanOptions, distributedState *distributedpb.DistributedState) error { - mutationExec := q.mutationExecFactory(q.planner, q.mdtp, q.mdconf, distributedState) + mutationExec := q.mutationExecFactory(q.planner, q.mdtp, q.mdfs, q.mdconf, distributedState) s, err := mutationExec.Execute(ctx, req, planOpts) if err != nil { diff --git a/src/vizier/services/query_broker/controllers/query_executor_test.go b/src/vizier/services/query_broker/controllers/query_executor_test.go index 1bbe5b35b19..710b54c0f28 100644 --- a/src/vizier/services/query_broker/controllers/query_executor_test.go +++ b/src/vizier/services/query_broker/controllers/query_executor_test.go @@ -409,7 +409,7 @@ func runTestCase(t *testing.T, test *queryExecTestCase) { } dp := &fakeDataPrivacy{} - queryExec := controllers.NewQueryExecutor("qb_address", "qb_hostname", at, dp, nc, nil, nil, rf, planner, test.MutExecFactory) + queryExec := controllers.NewQueryExecutor("qb_address", "qb_hostname", at, dp, nc, nil, nil, nil, rf, planner, test.MutExecFactory) consumer := newTestConsumer(test.ConsumeErrs) assert.Equal(t, test.QueryExecExpectedRunError, queryExec.Run(context.Background(), test.Req, consumer)) @@ -806,7 +806,7 @@ func buildMutationFailedQueryTestCase(t *testing.T) queryExecTestCase { QueryExecExpectedWaitError: err, StreamResultsErr: err, StreamResultsCallExpected: true, - MutExecFactory: func(planner controllers.Planner, client metadatapb.MetadataTracepointServiceClient, client2 metadatapb.MetadataConfigServiceClient, state *distributedpb.DistributedState) controllers.MutationExecutor { + MutExecFactory: func(planner controllers.Planner, client metadatapb.MetadataTracepointServiceClient, client2 metadatapb.MetadataFileSourceServiceClient, client3 metadatapb.MetadataConfigServiceClient, state *distributedpb.DistributedState) controllers.MutationExecutor { return &fakeMutationExecutor{ MutInfo: mutInfo, ExecuteStatus: nil, diff --git a/src/vizier/services/query_broker/controllers/server.go b/src/vizier/services/query_broker/controllers/server.go index 9626a8046d0..fae5d15ad91 100644 --- a/src/vizier/services/query_broker/controllers/server.go +++ b/src/vizier/services/query_broker/controllers/server.go @@ -82,6 +82,7 @@ type Server struct { healthcheckQuitOnce sync.Once mdtp metadatapb.MetadataTracepointServiceClient + mdfs metadatapb.MetadataFileSourceServiceClient mdconf metadatapb.MetadataConfigServiceClient resultForwarder QueryResultForwarder @@ -95,9 +96,8 @@ type QueryExecutorFactory func(*Server, MutationExecFactory) QueryExecutor // NewServer creates GRPC handlers. func NewServer(env querybrokerenv.QueryBrokerEnv, agentsTracker AgentsTracker, dataPrivacy DataPrivacy, - mds metadatapb.MetadataTracepointServiceClient, mdconf metadatapb.MetadataConfigServiceClient, - natsConn *nats.Conn, queryExecFactory QueryExecutorFactory, -) (*Server, error) { + mds metadatapb.MetadataTracepointServiceClient, mdfs metadatapb.MetadataFileSourceServiceClient, mdconf metadatapb.MetadataConfigServiceClient, + natsConn *nats.Conn, queryExecFactory QueryExecutorFactory) (*Server, error) { var udfInfo udfspb.UDFInfo if err := loadUDFInfo(&udfInfo); err != nil { return nil, err @@ -107,7 +107,7 @@ func NewServer(env querybrokerenv.QueryBrokerEnv, agentsTracker AgentsTracker, d return nil, err } - return NewServerWithForwarderAndPlanner(env, agentsTracker, dataPrivacy, NewQueryResultForwarder(), mds, mdconf, + return NewServerWithForwarderAndPlanner(env, agentsTracker, dataPrivacy, NewQueryResultForwarder(), mds, mdfs, mdconf, natsConn, c, queryExecFactory) } @@ -117,6 +117,7 @@ func NewServerWithForwarderAndPlanner(env querybrokerenv.QueryBrokerEnv, dataPrivacy DataPrivacy, resultForwarder QueryResultForwarder, mds metadatapb.MetadataTracepointServiceClient, + mdfs metadatapb.MetadataFileSourceServiceClient, mdconf metadatapb.MetadataConfigServiceClient, natsConn *nats.Conn, planner Planner, @@ -129,6 +130,7 @@ func NewServerWithForwarderAndPlanner(env querybrokerenv.QueryBrokerEnv, resultForwarder: resultForwarder, natsConn: natsConn, mdtp: mds, + mdfs: mdfs, mdconf: mdconf, planner: planner, queryExecFactory: queryExecFactory, diff --git a/src/vizier/services/query_broker/controllers/server_test.go b/src/vizier/services/query_broker/controllers/server_test.go index 1bd568c2631..2d11071385d 100644 --- a/src/vizier/services/query_broker/controllers/server_test.go +++ b/src/vizier/services/query_broker/controllers/server_test.go @@ -267,7 +267,7 @@ func TestCheckHealth(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(nil, nil, dp, nil, nil, nil, nil, nil, queryExecFactory) + s, err := controllers.NewServerWithForwarderAndPlanner(nil, nil, dp, nil, nil, nil, nil, nil, nil, queryExecFactory) require.NoError(t, err) err = s.CheckHealth(context.Background()) @@ -392,7 +392,7 @@ func TestExecuteScript(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(nil, nil, dp, nil, nil, nil, nil, nil, queryExecFactory) + s, err := controllers.NewServerWithForwarderAndPlanner(nil, nil, dp, nil, nil, nil, nil, nil, nil, queryExecFactory) require.NoError(t, err) // Set up mocks. @@ -456,7 +456,7 @@ func TestTransferResultChunk_AgentStreamComplete(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nc, nil, nil) + s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nil, nc, nil, nil) require.NoError(t, err) defer s.Close() @@ -547,7 +547,7 @@ func TestTransferResultChunk_AgentClosedPrematurely(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nc, nil, nil) + s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nil, nc, nil, nil) require.NoError(t, err) defer s.Close() @@ -631,7 +631,7 @@ func TestTransferResultChunk_AgentStreamFailed(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nc, nil, nil) + s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nil, nc, nil, nil) require.NoError(t, err) defer s.Close() @@ -709,7 +709,7 @@ func TestTransferResultChunk_ClientStreamCancelled(t *testing.T) { } dp := &fakeDataPrivacy{} - s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nc, nil, nil) + s, err := controllers.NewServerWithForwarderAndPlanner(env, &at, dp, &rf, nil, nil, nil, nc, nil, nil) require.NoError(t, err) defer s.Close() diff --git a/src/vizier/services/query_broker/query_broker_server.go b/src/vizier/services/query_broker/query_broker_server.go index ef037d32f8b..5bc9b74c6ec 100644 --- a/src/vizier/services/query_broker/query_broker_server.go +++ b/src/vizier/services/query_broker/query_broker_server.go @@ -141,6 +141,7 @@ func main() { mdsClient := metadatapb.NewMetadataServiceClient(mdsConn) mdtpClient := metadatapb.NewMetadataTracepointServiceClient(mdsConn) + mdfsClient := metadatapb.NewMetadataFileSourceServiceClient(mdsConn) mdconfClient := metadatapb.NewMetadataConfigServiceClient(mdsConn) csClient := metadatapb.NewCronScriptStoreServiceClient(mdsConn) @@ -170,7 +171,7 @@ func main() { agentTracker := tracker.NewAgents(mdsClient, viper.GetString("jwt_signing_key")) agentTracker.Start() defer agentTracker.Stop() - svr, err := controllers.NewServer(env, agentTracker, dataPrivacy, mdtpClient, mdconfClient, natsConn, controllers.NewQueryExecutorFromServer) + svr, err := controllers.NewServer(env, agentTracker, dataPrivacy, mdtpClient, mdfsClient, mdconfClient, natsConn, controllers.NewQueryExecutorFromServer) if err != nil { log.WithError(err).Fatal("Failed to initialize GRPC server funcs.") } diff --git a/src/vizier/services/query_broker/script_runner/script_runner.go b/src/vizier/services/query_broker/script_runner/script_runner.go index 48f78b9427b..fbe8afae032 100644 --- a/src/vizier/services/query_broker/script_runner/script_runner.go +++ b/src/vizier/services/query_broker/script_runner/script_runner.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "io" + "strings" "sync" "time" @@ -262,13 +263,17 @@ func (r *runner) runScript(scriptPeriod time.Duration) { } } - // We set the time 1 second in the past to cover colletor latency and request latencies + // We set the time 1 second in the past to cover collector latency and request latencies // which can cause data overlaps or cause data to be missed. startTime := r.lastRun.Add(-time.Second) endTime := startTime.Add(scriptPeriod) r.lastRun = time.Now() + // TODO(ddelnano): This might not be the correct approach for handling mutations. + // This is done until the pxlog source can work with an indefinite ttl. + hasMutation := strings.Contains(r.cronScript.Script, "pxlog") execScriptClient, err := r.vzClient.ExecuteScript(ctx, &vizierpb.ExecuteScriptRequest{ QueryStr: r.cronScript.Script, + Mutation: hasMutation, Configs: &vizierpb.Configs{ OTelEndpointConfig: otelEndpoint, PluginConfig: &vizierpb.Configs_PluginConfig{ diff --git a/src/vizier/services/query_broker/tracker/agents_info.go b/src/vizier/services/query_broker/tracker/agents_info.go index f881c974832..f36ebe8dd06 100644 --- a/src/vizier/services/query_broker/tracker/agents_info.go +++ b/src/vizier/services/query_broker/tracker/agents_info.go @@ -128,7 +128,7 @@ func (a *AgentsInfoImpl) UpdateAgentsInfo(update *metadatapb.AgentUpdatesRespons } else { // this is a Kelvin kelvinGRPCAddress := agent.Info.IPAddress - carnotInfoMap[agentUUID] = makeKelvinCarnotInfo(agentUUID, kelvinGRPCAddress, agent.ASID) + carnotInfoMap[agentUUID] = makeKelvinCarnotInfo(agentUUID, kelvinGRPCAddress, agent.ASID, agent.Info.Capabilities.StoresData) } } // case 2: agent data info update @@ -197,14 +197,14 @@ func makeAgentCarnotInfo(agentID uuid.UUID, asid uint32, agentMetadata *distribu } } -func makeKelvinCarnotInfo(agentID uuid.UUID, grpcAddress string, asid uint32) *distributedpb.CarnotInfo { +func makeKelvinCarnotInfo(agentID uuid.UUID, grpcAddress string, asid uint32, storesData bool) *distributedpb.CarnotInfo { return &distributedpb.CarnotInfo{ QueryBrokerAddress: agentID.String(), AgentID: utils.ProtoFromUUID(agentID), ASID: asid, HasGRPCServer: true, GRPCAddress: grpcAddress, - HasDataStore: false, + HasDataStore: storesData, ProcessesData: true, AcceptsRemoteSources: true, // When we support persistent storage, Kelvins will also have MetadataInfo. diff --git a/src/vizier/services/shared/agentpb/agent.pb.go b/src/vizier/services/shared/agentpb/agent.pb.go index 4cd57a106ea..c7fa65e27bd 100755 --- a/src/vizier/services/shared/agentpb/agent.pb.go +++ b/src/vizier/services/shared/agentpb/agent.pb.go @@ -56,6 +56,7 @@ func (AgentState) EnumDescriptor() ([]byte, []int) { type AgentCapabilities struct { CollectsData bool `protobuf:"varint,1,opt,name=collects_data,json=collectsData,proto3" json:"collects_data,omitempty"` + StoresData bool `protobuf:"varint,2,opt,name=stores_data,json=storesData,proto3" json:"stores_data,omitempty"` } func (m *AgentCapabilities) Reset() { *m = AgentCapabilities{} } @@ -97,6 +98,13 @@ func (m *AgentCapabilities) GetCollectsData() bool { return false } +func (m *AgentCapabilities) GetStoresData() bool { + if m != nil { + return m.StoresData + } + return false +} + type AgentParameters struct { ProfilerStackTraceSamplePeriodMS int32 `protobuf:"varint,1,opt,name=profiler_stack_trace_sample_period_ms,json=profilerStackTraceSamplePeriodMs,proto3" json:"profiler_stack_trace_sample_period_ms,omitempty"` } @@ -483,61 +491,62 @@ func init() { } var fileDescriptor_fef0af3bd5248f34 = []byte{ - // 864 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xc6, 0x49, 0x6c, 0x4f, 0xe2, 0xc6, 0x9d, 0x46, 0xd4, 0x84, 0x6a, 0x37, 0x72, 0x41, - 0x2a, 0x05, 0xad, 0x51, 0x90, 0xa0, 0x17, 0x40, 0x76, 0xec, 0x62, 0xab, 0x65, 0x63, 0xcd, 0x3a, - 0x41, 0x70, 0x19, 0x8d, 0x77, 0x27, 0xc9, 0xd0, 0xf5, 0xee, 0x68, 0x66, 0x62, 0x55, 0x3d, 0x71, - 0xe4, 0xc8, 0x5f, 0xe0, 0xc6, 0x4f, 0xe1, 0x98, 0x63, 0x4f, 0x16, 0xd9, 0x70, 0xe8, 0xb1, 0x3f, - 0x01, 0xed, 0xdb, 0x75, 0x53, 0xb7, 0x52, 0x93, 0xd3, 0xbe, 0x79, 0xdf, 0xf7, 0xbd, 0x37, 0xf3, - 0xbd, 0x27, 0x1b, 0xb9, 0x5a, 0x05, 0xed, 0x99, 0x78, 0x21, 0xb8, 0x6a, 0x6b, 0xae, 0x66, 0x22, - 0xe0, 0xba, 0xad, 0x4f, 0x99, 0xe2, 0x61, 0x9b, 0x9d, 0xf0, 0xd8, 0xc8, 0x49, 0xfe, 0x75, 0xa5, - 0x4a, 0x4c, 0x82, 0x1d, 0xf9, 0xdc, 0xcd, 0xe9, 0xee, 0x82, 0xee, 0xe6, 0x74, 0x17, 0x68, 0x3b, - 0xdb, 0x27, 0xc9, 0x49, 0x02, 0xdc, 0x76, 0x16, 0xe5, 0xb2, 0x1d, 0x27, 0x6b, 0xc3, 0xa4, 0x68, - 0xe7, 0xc8, 0xd9, 0x99, 0x08, 0xe5, 0x04, 0x3e, 0x39, 0xa1, 0xf5, 0x08, 0xdd, 0xee, 0x64, 0xfa, - 0x7d, 0x26, 0xd9, 0x44, 0x44, 0xc2, 0x08, 0xae, 0xf1, 0x7d, 0x54, 0x0f, 0x92, 0x28, 0xe2, 0x81, - 0xd1, 0x34, 0x64, 0x86, 0x35, 0xad, 0x5d, 0xeb, 0x41, 0x95, 0x6c, 0x2e, 0x92, 0x3d, 0x66, 0x58, - 0xeb, 0x0f, 0x0b, 0x6d, 0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a5, 0x61, 0xe1, 0x7b, 0xa8, 0xb9, 0xac, 0x20, 0x7d, - 0x7f, 0x74, 0xe0, 0xf9, 0xc3, 0xa3, 0x7e, 0x63, 0xe5, 0x5d, 0xb4, 0x37, 0xf4, 0xf7, 0x0f, 0x3c, - 0xaf, 0xbf, 0x3f, 0xee, 0xf7, 0x1a, 0xe5, 0xee, 0x77, 0xe7, 0x17, 0x76, 0xe9, 0xe5, 0x85, 0x5d, - 0x7a, 0x7d, 0x61, 0x5b, 0xbf, 0xa7, 0xb6, 0xf5, 0x77, 0x6a, 0x5b, 0xff, 0xa4, 0xb6, 0x75, 0x9e, - 0xda, 0xd6, 0xbf, 0xa9, 0x6d, 0xbd, 0x4a, 0xed, 0xd2, 0xeb, 0xd4, 0xb6, 0xfe, 0xbc, 0xb4, 0x4b, - 0xe7, 0x97, 0x76, 0xe9, 0xe5, 0xa5, 0x5d, 0xfa, 0xb5, 0x52, 0xfc, 0x3f, 0x4c, 0xd6, 0xe1, 0x27, - 0xfc, 0xeb, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xec, 0x47, 0x21, 0x4c, 0x06, 0x00, 0x00, + // 879 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x41, 0x6f, 0xdb, 0x36, + 0x14, 0xb6, 0xe2, 0x24, 0xb6, 0x5f, 0xe2, 0xc6, 0x65, 0x83, 0xd5, 0xcb, 0x0a, 0x29, 0x70, 0x37, + 0xa0, 0xeb, 0x06, 0x79, 0xc8, 0x80, 0x6d, 0x97, 0x6d, 0xb0, 0x63, 0x77, 0x36, 0xda, 0x29, 0x06, + 0xe5, 0x64, 0xe8, 0x2e, 0x02, 0x2d, 0x31, 0x09, 0x57, 0x59, 0x12, 0x48, 0xc6, 0x28, 0x7a, 0xda, + 0x71, 0xc7, 0xfd, 0x85, 0xdd, 0xf6, 0x53, 0x76, 0xcc, 0xb1, 0x27, 0x63, 0x51, 0x76, 0xe8, 0xb1, + 0x3f, 0x61, 0xd0, 0x93, 0xdc, 0xd4, 0x2d, 0xd0, 0xe4, 0x24, 0xf2, 0x7d, 0xdf, 0xf7, 0x3e, 0xf2, + 0x7b, 0x84, 0x0d, 0xb6, 0x92, 0x7e, 0x7b, 0x26, 0x5e, 0x08, 0x2e, 0xdb, 0x8a, 0xcb, 0x99, 0xf0, + 0xb9, 0x6a, 0xab, 0x53, 0x26, 0x79, 0xd0, 0x66, 0x27, 0x3c, 0xd2, 0xc9, 0x24, 0xff, 0xda, 0x89, + 0x8c, 0x75, 0x4c, 0xac, 0xe4, 0xb9, 0x9d, 0xd3, 0xed, 0x05, 0xdd, 0xce, 0xe9, 0x36, 0xd2, 0x76, + 0xb6, 0x4f, 0xe2, 0x93, 0x18, 0xb9, 0xed, 0x6c, 0x95, 0xcb, 0x76, 0xac, 0xcc, 0x86, 0x25, 0xa2, + 0x9d, 0x23, 0x67, 0x67, 0x22, 0x48, 0x26, 0xf8, 0xc9, 0x09, 0xad, 0xa7, 0x70, 0xbb, 0x93, 0xe9, + 0xf7, 0x59, 0xc2, 0x26, 0x22, 0x14, 0x5a, 0x70, 0x45, 0xee, 0x43, 0xdd, 0x8f, 0xc3, 0x90, 0xfb, + 0x5a, 0x79, 0x01, 0xd3, 0xac, 0x69, 0xec, 0x1a, 0x0f, 0xaa, 0x74, 0x73, 0x51, 0xec, 0x31, 0xcd, + 0x88, 0x05, 0x1b, 0x4a, 0xc7, 0x92, 0x17, 0x94, 0x15, 0xa4, 0x40, 0x5e, 0xca, 0x08, 0xad, 0x3f, + 0x0c, 0xd8, 0xc2, 0xde, 0x23, 0x26, 0xd9, 0x94, 0x6b, 0x2e, 0x15, 0x39, 0x83, 0xcf, 0x12, 0x19, + 0x1f, 0x8b, 0x90, 0x4b, 0x4f, 0x69, 0xe6, 0x3f, 0xf3, 0xb4, 0x64, 0x3e, 0xf7, 0x14, 0x9b, 0x26, + 0x21,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bf, 0x3f, 0xee, 0xf7, 0x1a, 0xe5, 0xee, 0xf7, 0xe7, 0x17, 0x66, 0xe9, 0xe5, 0x85, 0x59, 0x7a, + 0x7d, 0x61, 0x1a, 0xbf, 0xa7, 0xa6, 0xf1, 0x77, 0x6a, 0x1a, 0xff, 0xa4, 0xa6, 0x71, 0x9e, 0x9a, + 0xc6, 0xbf, 0xa9, 0x69, 0xbc, 0x4a, 0xcd, 0xd2, 0xeb, 0xd4, 0x34, 0xfe, 0xbc, 0x34, 0x4b, 0xe7, + 0x97, 0x66, 0xe9, 0xe5, 0xa5, 0x59, 0xfa, 0xb5, 0x52, 0xfc, 0x81, 0x4c, 0xd6, 0xf1, 0x37, 0xfe, + 0xeb, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x58, 0xba, 0x29, 0x6d, 0x06, 0x00, 0x00, } func (x AgentState) String() string { @@ -569,6 +578,9 @@ func (this *AgentCapabilities) Equal(that interface{}) bool { if this.CollectsData != that1.CollectsData { return false } + if this.StoresData != that1.StoresData { + return false + } return true } func (this *AgentParameters) Equal(that interface{}) bool { @@ -761,9 +773,10 @@ func (this *AgentCapabilities) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 5) + s := make([]string, 0, 6) s = append(s, "&agentpb.AgentCapabilities{") s = append(s, "CollectsData: "+fmt.Sprintf("%#v", this.CollectsData)+",\n") + s = append(s, "StoresData: "+fmt.Sprintf("%#v", this.StoresData)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -881,6 +894,16 @@ func (m *AgentCapabilities) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.StoresData { + i-- + if m.StoresData { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } if m.CollectsData { i-- if m.CollectsData { @@ -1207,6 +1230,9 @@ func (m *AgentCapabilities) Size() (n int) { if m.CollectsData { n += 2 } + if m.StoresData { + n += 2 + } return n } @@ -1346,6 +1372,7 @@ func (this *AgentCapabilities) String() string { } s := strings.Join([]string{`&AgentCapabilities{`, `CollectsData:` + fmt.Sprintf("%v", this.CollectsData) + `,`, + `StoresData:` + fmt.Sprintf("%v", this.StoresData) + `,`, `}`, }, "") return s @@ -1481,6 +1508,26 @@ func (m *AgentCapabilities) Unmarshal(dAtA []byte) error { } } m.CollectsData = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoresData", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAgent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StoresData = bool(v != 0) default: iNdEx = preIndex skippy, err := skipAgent(dAtA[iNdEx:]) diff --git a/src/vizier/services/shared/agentpb/agent.proto b/src/vizier/services/shared/agentpb/agent.proto index b95cb1def0f..1e7586d039e 100644 --- a/src/vizier/services/shared/agentpb/agent.proto +++ b/src/vizier/services/shared/agentpb/agent.proto @@ -28,6 +28,7 @@ import "src/api/proto/uuidpb/uuid.proto"; // AgentCapabilities describes functions that the agent has available. message AgentCapabilities { bool collects_data = 1; + bool stores_data = 2; } message AgentParameters {