@@ -593,8 +593,8 @@ Error Database::AddInstance(const launcher::InstanceInfo& info)
593593 FromAos (info, row);
594594 *mSession << " INSERT INTO launcher_instances (itemID, subjectID, instance, type, preinstalled, manifestDigest, "
595595 " nodeID, prevNodeID, runtimeID, uid, gid, timestamp, state, isUnitSubject, version, ownerID, "
596- " subjectType, labels, priority) "
597- " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" ,
596+ " subjectType, labels, priority, disableRebalancing ) "
597+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );" ,
598598 bind (row), now;
599599 } catch (const std::exception& e) {
600600 return AOS_ERROR_WRAP (common::utils::ToAosError (e));
@@ -613,16 +613,17 @@ Error Database::UpdateInstance(const launcher::InstanceInfo& info)
613613 statement
614614 << " UPDATE launcher_instances SET manifestDigest = ?, nodeID = ?, prevNodeID = ?, runtimeID = ?, uid = ?, "
615615 " gid = ?, timestamp = ?, state = ?, isUnitSubject = ?, ownerID = ?, subjectType = ?, labels = ?, "
616- " priority = ? "
616+ " priority = ?, disableRebalancing = ? "
617617 " WHERE itemID = ? AND subjectID = ? AND instance = ? "
618618 " AND type = ? AND preinstalled = ? AND version = ?;" ,
619619 bind (info.mManifestDigest .CStr ()), bind (info.mNodeID .CStr ()), bind (info.mPrevNodeID .CStr ()),
620620 bind (info.mRuntimeID .CStr ()), bind (info.mUID ), bind (info.mGID ), bind (info.mTimestamp .UnixNano ()),
621621 bind (info.mState .ToString ().CStr ()), bind (info.mIsUnitSubject ), bind (info.mOwnerID .CStr ()),
622622 bind (info.mSubjectType .ToString ().CStr ()), bind (SerializeLabels (info.mLabels )), bind (info.mPriority ),
623- bind (info.mInstanceIdent .mItemID .CStr ()), bind (info.mInstanceIdent .mSubjectID .CStr ()),
624- bind (info.mInstanceIdent .mInstance ), bind (info.mInstanceIdent .mType .ToString ().CStr ()),
625- bind (info.mInstanceIdent .mPreinstalled ), bind (info.mVersion .CStr ());
623+ bind (info.mDisableRebalancing ), bind (info.mInstanceIdent .mItemID .CStr ()),
624+ bind (info.mInstanceIdent .mSubjectID .CStr ()), bind (info.mInstanceIdent .mInstance ),
625+ bind (info.mInstanceIdent .mType .ToString ().CStr ()), bind (info.mInstanceIdent .mPreinstalled ),
626+ bind (info.mVersion .CStr ());
626627
627628 if (statement.execute () != 1 ) {
628629 return ErrorEnum::eNotFound;
@@ -643,7 +644,7 @@ Error Database::LoadActiveInstances(Array<launcher::InstanceInfo>& instances) co
643644
644645 *mSession << " SELECT itemID, subjectID, instance, type, preinstalled, manifestDigest, nodeID, prevNodeID, "
645646 " runtimeID, uid, gid, timestamp, state, isUnitSubject, version, ownerID, subjectType, labels, "
646- " priority "
647+ " priority, disableRebalancing "
647648 " FROM launcher_instances;" ,
648649 into (rows), now;
649650
@@ -1089,6 +1090,7 @@ void Database::CreateTables()
10891090 " subjectType TEXT,"
10901091 " labels TEXT,"
10911092 " priority INTEGER,"
1093+ " disableRebalancing INTEGER,"
10921094 " PRIMARY KEY(itemID,subjectID,instance,type,preinstalled,version)"
10931095 " );" ,
10941096 now;
@@ -1223,6 +1225,7 @@ void Database::FromAos(const launcher::InstanceInfo& src, LauncherInstanceInfoRo
12231225 dst.set <ToInt (LauncherInstanceInfoColumns::eSubjectType)>(src.mSubjectType .ToString ().CStr ());
12241226 dst.set <ToInt (LauncherInstanceInfoColumns::eLabels)>(SerializeLabels (src.mLabels ));
12251227 dst.set <ToInt (LauncherInstanceInfoColumns::ePriority)>(src.mPriority );
1228+ dst.set <ToInt (LauncherInstanceInfoColumns::eDisableRebalancing)>(src.mDisableRebalancing );
12261229}
12271230
12281231void Database::ToAos (const LauncherInstanceInfoRow& src, launcher::InstanceInfo& dst)
@@ -1260,7 +1263,8 @@ void Database::ToAos(const LauncherInstanceInfoRow& src, launcher::InstanceInfo&
12601263 AOS_ERROR_CHECK_AND_THROW (AOS_ERROR_WRAP (err), " failed to parse subject type" );
12611264
12621265 DeserializeLabels (src.get <ToInt (LauncherInstanceInfoColumns::eLabels)>(), dst.mLabels );
1263- dst.mPriority = src.get <ToInt (LauncherInstanceInfoColumns::ePriority)>();
1266+ dst.mPriority = src.get <ToInt (LauncherInstanceInfoColumns::ePriority)>();
1267+ dst.mDisableRebalancing = src.get <ToInt (LauncherInstanceInfoColumns::eDisableRebalancing)>();
12641268}
12651269
12661270void Database::FromAos (const imagemanager::ItemInfo& src, ImageManagerItemInfoRow& dst)
0 commit comments