summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorroot <root@da1234cao>2024-03-26 16:04:00 +0800
committerroot <root@da1234cao>2024-03-26 16:04:00 +0800
commit669da17eb54f97dfe2ec282df1cd1d1174e95756 (patch)
tree14311d0ce9ce45bc645e51b9d2c0e8cc07a7fa2c /src
parent6b22f87587079a003afce7c495c7cf9b8eaf5c42 (diff)
init repository
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/job_ctx.c38
-rw-r--r--src/job_ctx.h12
-rw-r--r--src/main.c8
4 files changed, 61 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..f590bcf
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,3 @@
+
+add_executable(${PROJECT_NAME} main.c)
+target_link_libraries(${PROJECT_NAME} libmarsio maatframe) \ No newline at end of file
diff --git a/src/job_ctx.c b/src/job_ctx.c
new file mode 100644
index 0000000..0cefb00
--- /dev/null
+++ b/src/job_ctx.c
@@ -0,0 +1,38 @@
+#include "job_ctx.h"
+#include <MESA/maat.h>
+
+#if 0
+static void telemetry_job_add_cb(const char * table_name, int table_id, const char * key, const char * table_line,
+ void ** ad, long argl, void * argp)
+{
+ return;
+}
+
+static void telemetry_job_del_cb(const char * table_name, int table_id, const char * key, const char * table_line,
+ void ** ad, long argl, void * argp)
+{
+ return;
+}
+
+int maat_register()
+{
+ struct maat_options * opts = maat_options_new();
+ struct maat * maat_instance = maat_new(opts, "");
+ maat_get_table_id(maat_instance, DP_TRACE_TELEMETRY_TABLE);
+
+ int ret = maat_plugin_table_ex_schema_register(maat_instance, DP_TRACE_TELEMETRY_TABLE, telemetry_job_add_cb,
+ telemetry_job_del_cb, NULL, 0, NULL);
+
+ if (ret != 0)
+ {
+ MR_ERROR("failed at register callback of DP_TRACE_TELEMETRY_TABLE, ret = %d", ret);
+ return -1;
+ }
+
+ return 1;
+}
+#endif
+
+int maat_register_hook()
+{
+} \ No newline at end of file
diff --git a/src/job_ctx.h b/src/job_ctx.h
new file mode 100644
index 0000000..60985bd
--- /dev/null
+++ b/src/job_ctx.h
@@ -0,0 +1,12 @@
+#pragma once
+#include "marsio.h"
+#include <uuid/uuid.h>
+
+#define DP_TRACE_TELEMETRY_TABLE "DP_TRACE_TELEMETRY_TABLE"
+
+struct dp_trace_telemetry_desc
+{
+ uuid_t uuid;
+ job_bitmap_t job_id;
+ struct dp_trace_job_desc;
+}; \ No newline at end of file
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..0d33bba
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,8 @@
+#include "marsio.h"
+
+struct mr_instance * mr_instance = NULL;
+
+int main(int argc, char * argv)
+{
+ mr_instance = marsio_create();
+} \ No newline at end of file