* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
#ifndef UDF_BUILT_IN_FSM_STATE_DEFINE_H
#define UDF_BUILT_IN_FSM_STATE_DEFINE_H
#include <memory>
#include "common/udf_log.h"
#include "flow_func/flow_func_log.h"
#include "hccl/base.h"
namespace FlowFunc {
constexpr const char *kMaxTimeCost = " with max time cost";
constexpr const char *kCommonTimeCost = "";
class LlmCommEntity;
using EntityPtr = std::shared_ptr<LlmCommEntity>;
enum class FsmStatus : int32_t {
kFsmSuccess = 0,
kFsmTimeout = 1,
kFsmKvNotExist = 2,
kFsmRepeatRequest = 3,
kFsmParamInvalid = 5,
kFsmNotLink = 7,
kFsmAlreadyLinked = 8,
kFsmLinkFailed = 9,
kFsmUnlinkFailed = 10,
kFsmNotifyPromptUnlinkFailed = 11,
kFsmReqOverLimit = 12,
kFsmOutOfMemory = 14,
kFsmPrefixAlreadyExist = 15,
kFsmPrefixNotExist = 16,
kFsmCacheIncompatible = 20,
kFsmCacheKeyAlreadyExist = 21,
kFsmCopyKvFailed = 22,
kFsmCacheIdAlreadyExist = 23,
kFsmExistLink = 24,
kFsmLinkBusy = 27,
kFsmFailed = 1000,
kFsmHcclFailed = 1001,
kFsmMbufFailed = 1002,
kFsmDrvFailed = 1003,
kFsmKeepState = 1004,
kFsmEstablishLinkSuc = 1005,
kFsmIgnore,
};
enum class FsmState : int32_t {
kFsmInitState = 0,
kFsmLinkState,
kFsmIdleState,
kFsmProbeState,
kFsmReceiveTransferReqState,
kFsmReceiveTransferCacheState,
kFsmReceiveCheckState,
kFsmReceiveState,
kFsmSendState,
kFsmUnlinkState,
kFsmDestroyState,
kFsmErrorState,
kFsmInvalidState
};
enum class EntityType : int32_t {
kEntityClient = 0,
kEntityServer
};
}
#endif