diff --git a/core/pipeline/Pipeline.cpp b/core/pipeline/Pipeline.cpp index 8d4c2a75d6..0f756d3af0 100644 --- a/core/pipeline/Pipeline.cpp +++ b/core/pipeline/Pipeline.cpp @@ -84,12 +84,12 @@ bool Pipeline::Init(PipelineConfig&& config) { bool hasFlusherSLS = false; // to send alarm and init MetricsRecord before flusherSLS is built, a temporary object is made, which will be - unique_ptr SLSTmp = make_unique(); + FlusherSLS SLSTmp; if (!config.mProject.empty()) { - SLSTmp->mProject = config.mProject; - SLSTmp->mLogstore = config.mLogstore; - SLSTmp->mRegion = config.mRegion; - mContext.SetSLSInfo(SLSTmp.get()); + SLSTmp.mProject = config.mProject; + SLSTmp.mLogstore = config.mLogstore; + SLSTmp.mRegion = config.mRegion; + mContext.SetSLSInfo(&SLSTmp); } mPluginID.store(0); diff --git a/core/plugin/flusher/sls/FlusherSLS.cpp b/core/plugin/flusher/sls/FlusherSLS.cpp index 614f121700..7387d75547 100644 --- a/core/plugin/flusher/sls/FlusherSLS.cpp +++ b/core/plugin/flusher/sls/FlusherSLS.cpp @@ -959,7 +959,7 @@ void FlusherSLS::GenerateGoPlugin(const Json::Value& config, Json::Value& res) c detail[itr.name()] = *itr; } } - if (!detail.empty()) { + if (mContext->IsFlushingThroughGoPipeline()) { Json::Value plugin(Json::objectValue); plugin["type"] = Pipeline::GenPluginTypeWithID("flusher_sls", mContext->GetPipeline().GetNowPluginID()); plugin["detail"] = detail; diff --git a/core/unittest/config/PipelineConfigUnittest.cpp b/core/unittest/config/PipelineConfigUnittest.cpp index e3dcfc5d4f..373b7a44ae 100644 --- a/core/unittest/config/PipelineConfigUnittest.cpp +++ b/core/unittest/config/PipelineConfigUnittest.cpp @@ -80,7 +80,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ], "extensions": [ @@ -496,7 +496,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -533,7 +533,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -566,7 +566,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -591,7 +591,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -623,7 +623,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -663,7 +663,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -691,7 +691,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -731,7 +731,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -767,7 +767,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -787,7 +787,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -814,7 +814,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -849,7 +849,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -877,7 +877,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -917,7 +917,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -953,7 +953,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -981,7 +981,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1016,7 +1016,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1059,7 +1059,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1090,7 +1090,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1133,7 +1133,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1172,7 +1172,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1195,7 +1195,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1225,7 +1225,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1263,7 +1263,7 @@ void PipelineConfigUnittest::HandleValidConfig() const { "Type": "flusher_sls" }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1932,7 +1932,7 @@ void PipelineConfigUnittest::HandleInvalidAggregators() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } diff --git a/core/unittest/flusher/FlusherSLSUnittest.cpp b/core/unittest/flusher/FlusherSLSUnittest.cpp index 3639b7b44c..cc0328f7b8 100644 --- a/core/unittest/flusher/FlusherSLSUnittest.cpp +++ b/core/unittest/flusher/FlusherSLSUnittest.cpp @@ -444,7 +444,37 @@ void FlusherSLSUnittest::OnSuccessfulInit() { ctx.SetExactlyOnceFlag(false); SenderQueueManager::GetInstance()->Clear(); - // additional param + // go param + ctx.SetIsFlushingThroughGoPipelineFlag(true); + configStr = R"( + { + "Type": "flusher_sls", + "Project": "test_project", + "Logstore": "test_logstore", + "Region": "cn-hangzhou", + "Endpoint": "cn-hangzhou.log.aliyuncs.com", + } + )"; + optionalGoPipelineStr = R"( + { + "flushers": [ + { + "type": "flusher_sls/4", + "detail": {} + } + ] + } + )"; + APSARA_TEST_TRUE(ParseJsonTable(configStr, configJson, errorMsg)); + APSARA_TEST_TRUE(ParseJsonTable(optionalGoPipelineStr, optionalGoPipelineJson, errorMsg)); + pipeline.mPluginID.store(4); + flusher.reset(new FlusherSLS()); + flusher->SetContext(ctx); + flusher->SetMetricsRecordRef(FlusherSLS::sName, "1"); + APSARA_TEST_TRUE(flusher->Init(configJson, optionalGoPipeline)); + APSARA_TEST_TRUE(optionalGoPipelineJson == optionalGoPipeline); + optionalGoPipeline.clear(); + configStr = R"( { "Type": "flusher_sls", @@ -475,6 +505,7 @@ void FlusherSLSUnittest::OnSuccessfulInit() { flusher->SetMetricsRecordRef(FlusherSLS::sName, "1"); APSARA_TEST_TRUE(flusher->Init(configJson, optionalGoPipeline)); APSARA_TEST_EQUAL(optionalGoPipelineJson.toStyledString(), optionalGoPipeline.toStyledString()); + ctx.SetIsFlushingThroughGoPipelineFlag(false); SenderQueueManager::GetInstance()->Clear(); } diff --git a/core/unittest/pipeline/PipelineUnittest.cpp b/core/unittest/pipeline/PipelineUnittest.cpp index 89df992071..8f3b98a77d 100644 --- a/core/unittest/pipeline/PipelineUnittest.cpp +++ b/core/unittest/pipeline/PipelineUnittest.cpp @@ -141,7 +141,7 @@ void PipelineUnittest::OnSuccessfulInit() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -183,7 +183,7 @@ void PipelineUnittest::OnSuccessfulInit() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ], "extensions": [ @@ -237,7 +237,7 @@ void PipelineUnittest::OnSuccessfulInit() const { ], "flushers": [ { - "type": "flusher_kafka_v2/6", + "type": "flusher_http/6", "detail": {} } ], @@ -513,6 +513,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); // topology 2: extended -> native -> native configStr = R"( @@ -653,6 +654,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 5: extended -> extended -> native @@ -726,6 +728,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 6: (native, extended) -> extended -> native @@ -839,6 +842,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 8: extended -> (native -> extended) -> native @@ -952,6 +956,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); // topology 11: extended -> none -> native (future changes maybe applied) configStr = R"( @@ -1013,6 +1018,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 12: (native, extended) -> none -> native @@ -1067,7 +1073,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1087,7 +1093,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/6", + "type": "flusher_http/6", "detail": {} } ] @@ -1105,6 +1111,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 14: extended -> native -> extended @@ -1125,7 +1132,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1159,7 +1166,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1187,7 +1194,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1213,7 +1220,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/6", + "type": "flusher_http/6", "detail": {} } ] @@ -1231,6 +1238,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 17: extended -> extended -> extended @@ -1248,7 +1256,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1279,7 +1287,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/4", + "type": "flusher_http/4", "detail": {} } ] @@ -1297,6 +1305,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 18: (native, extended) -> extended -> extended @@ -1320,7 +1329,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1354,7 +1363,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1380,7 +1389,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/7", + "type": "flusher_http/7", "detail": {} } ] @@ -1398,6 +1407,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 20: extended -> (native -> extended) -> extended @@ -1421,7 +1431,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1458,7 +1468,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1481,7 +1491,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1501,7 +1511,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/5", + "type": "flusher_http/5", "detail": {} } ] @@ -1519,6 +1529,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 23: extended -> none -> extended @@ -1531,7 +1542,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1556,7 +1567,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "type": "flusher_kafka_v2/3", + "type": "flusher_http/3", "detail": {} } ] @@ -1574,6 +1585,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(0U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 24: (native, extended) -> none -> extended @@ -1592,7 +1604,7 @@ void PipelineUnittest::OnInitVariousTopology() const { ], "flushers": [ { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1631,7 +1643,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1657,7 +1669,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/7", + "type": "flusher_http/7", "detail": {} } ] @@ -1675,6 +1687,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 26: extended -> native -> (native, extended) @@ -1703,7 +1716,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1745,7 +1758,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1781,7 +1794,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1813,7 +1826,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/7", + "type": "flusher_http/7", "detail": {} } ] @@ -1831,6 +1844,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 29: extended -> extended -> (native, extended) @@ -1856,7 +1870,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1893,7 +1907,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/5", + "type": "flusher_http/5", "detail": {} } ] @@ -1911,6 +1925,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 30: (native, extended) -> extended -> (native, extended) @@ -1942,7 +1957,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -1984,7 +1999,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -2016,7 +2031,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/8", + "type": "flusher_http/8", "detail": {} } ] @@ -2034,6 +2049,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 32: extended -> (native -> extended) -> (native, extended) @@ -2065,7 +2081,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -2110,7 +2126,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -2141,7 +2157,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -2167,7 +2183,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/6", + "type": "flusher_http/6", "detail": {} } ] @@ -2185,6 +2201,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithInput.isNull()); APSARA_TEST_EQUAL(goPipelineWithoutInput.toStyledString(), pipeline->mGoPipelineWithoutInput.toStyledString()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithoutInput.clear(); // topology 35: extended -> none -> (native, extended) @@ -2205,7 +2222,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] } @@ -2236,7 +2253,7 @@ void PipelineUnittest::OnInitVariousTopology() const { } }, { - "type": "flusher_kafka_v2/4", + "type": "flusher_http/4", "detail": {} } ] @@ -2254,6 +2271,7 @@ void PipelineUnittest::OnInitVariousTopology() const { APSARA_TEST_EQUAL(1U, pipeline->GetFlushers().size()); APSARA_TEST_EQUAL(goPipelineWithInput.toStyledString(), pipeline->mGoPipelineWithInput.toStyledString()); APSARA_TEST_TRUE(pipeline->mGoPipelineWithoutInput.isNull()); + APSARA_TEST_NOT_EQUAL(nullptr, pipeline->GetContext().GetSLSInfo()); goPipelineWithInput.clear(); // topology 36: (native, extended) -> none -> (native, extended) @@ -2280,7 +2298,7 @@ void PipelineUnittest::OnInitVariousTopology() const { "EnableShardHash": false }, { - "Type": "flusher_kafka_v2" + "Type": "flusher_http" } ] }