<commit_before><?xml version="1.0" encoding="UTF-8"?>
<starosxml xmlns="http://www.staros.xyz/starcore/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" scope="application">
	<class name="CGroupManager">
		<private>
			<container name="groupContainer" type="hashmap" keytype="string" valuetype="hashmap"/>
		</private>
		<public>
			<function name="InstallGroupRequest">
				<parameters>
					<parameter name="datapathid" type="string"/>
					<parameter name="strjson" type="string"/>
					<parameter name="resourceid" type="string"/>
				</parameters>
				<container name="switchgroup" type="hashmap" keytype="string" valuetype="string"/>
				<variable name="sresourceid" type="string"/>
				<variable name="transportid" type="string"/>
				<set name="sresourceid" value="context.allocResourceId()"/>
				<!--qiulei modify 20170807-->
				<if cond="context.merterContainer.hasValue(context.datapathid.toString())==true">
					<then>
						<lookup name="merterContainer" key="context.datapathid.toString()" output="context.switchgroup"/>
					</then>
					<else>
						<insert name="merterContainer" key="context.datapathid.toString()" value="context.switchgroup"/>
					</else>
				</if>
				<insert name="switchgroup" key="context.sresourceid.toString()" value="context.strjson.toString()"/>
				<function name="GetTransportIdFromDevice" class="DeviceManager">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="transportid" type="string" out="context.transportid"/>
					</parameters>
				</function>
				<function name="Send_OFPT13_GROUP_MOD">
					
			<log>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  InstallGroupRequest   Send_OFPT13_GROUP_MOD  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</log>
					<parameters>
						<parameter name="transportid" type="string" in="context.transportid"/>
						<parameter name="strjson" type="string" in="context.modstrjson.toString()"/>
					</parameters>
				</function>
				<set name="resourceid" value="context.sresourceid.toString()"/>
			</function>
			<function name="UnInstallGroupRequest">
				<parameters>
					<parameter name="datapathid" type="string"/>
					<parameter name="resourceid" type="string"/>
				</parameters>
				<variable name="transportid" type="string"/>
				<container name="switchgroup" type="hashmap" keytype="string" valuetype="string"/>
				<variable name="flowmodjson" type="string"/>
				<variable name="sendflowmodjson" type="string"/>
				<if cond="context.merterContainer.hasValue(context.datapathid.toString()) ==true">
					<then>
						<function>
							<lookup name="merterContainer" key="context.datapathid.toString()" output="context.switchgroup"/>
						</function>
					</then>
					<else>
						<function>
							<log>UnInstallMeterRequest exit</log>
							<exit/>
						</function>
					</else>
				</if>
				<if cond="context.switchgroup.hasValue(context.resourceid.toString()) == true">
					<then>
						<function>
							<lookup name="switchgroup" key="context.resourceid.toString()" output="context.flowmodjson"/>
						</function>
					</then>
					<else>
						<function>
							<log>UnInstallMeterRequest exit2</log>
							<exit/>
						</function>
					</else>
				</if>
				<log><![CDATA[flowmodjson=<%=context.flowmodjson.toString()%>]]></log>
				<script><![CDATA[
						var info = JSON.parse(context.flowmodjson.toString());
						info.command='3';
						var strjson=JSON.stringify(info);
						context.sendflowmodjson.setValue(strjson);
				]]></script>
				<function name="GetTransportIdFromDevice" class="DeviceManager">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="transportid" type="string" out="context.transportid"/>
					</parameters>
				</function>
				<function name="Send_OFPT13_METER_MOD">
				
			<log>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  UnInstallGroupRequest   Send_OFPT13_GROUP_MOD  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</log>
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="strjson" type="string" in="context.sendflowmodjson.toString()"/>
					</parameters>
				</function>
				<remove name="switchgroup" key="context.resourceid.toString()"/>
			</function>
			<!--
				OFPGT_ALL = 0, /* All (multicast/broadcast) group. */
				OFPGT_SELECT = 1, /* Select group. */
				OFPGT_INDIRECT = 2, /* Indirect group. */
				OFPGT_FF = 3, /* Fast failover group. */
			-->
			<function name="testaddgroup">			
				<parameters>
						<parameter name="datapathid" type="string"/>
				</parameters>
				<variable name="modstrjson" type="string"/>
				<variable name="returnresourceid" type="string"/>
				<reference variable="modstrjson">
					<jsonbody><![CDATA[ 
						{
							"xid":"<%=context.openflowserverobj.getIncreaseXID()%>",
							"command":"1",
							"grouptype":"1",
							"groupid":"1",
							"bucketlist":[
								{
									"weight":"1",
									"watchport":"1000",
									"watchgroup":"1000",
									"actions":[
										{
											"type":"0",
											"outport":"0xfffffffd",
											"maxlen":"0xffff"
										}
									]
								}
							]
						}	
					]]></jsonbody>
				</reference>
				<function name="InstallGroupRequest">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="strjson" type="string" in="context.modstrjson.toString()"/>
						<parameter name="resourceid" type="string" out="returnresourceid"/>
					</parameters>
				</function>
				<log><![CDATA[InstallFlowTableRequest returnresourceid=<%=context.returnresourceid.toString()%>]]></log>
				
			</function>
			<function name="testremovegroup">			
				<parameters>
					<parameter name="datapathid" type="string"/>
				</parameters>
				<function name="InstallGroupRequest">
					<parameters>
						<parameter name="resourceid" type="string" out="context.resourceid"/>
					</parameters>
				</function>
				<log><![CDATA[InstallFlowTableRequest resourceid=<%=context.resourceid.toString()%>]]></log>
				
			</function>
		</public>
	</class>
</starosxml><commit_msg>fix some bugs<commit_after><?xml version="1.0" encoding="UTF-8"?>
<starosxml xmlns="http://www.staros.xyz/starcore/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" scope="application">
	<class name="CGroupManager">
		<private>
			<container name="groupContainer" type="hashmap" keytype="string" valuetype="hashmap"/>
		</private>
		<public>
			<function name="InstallGroupRequest">
				<parameters>
					<parameter name="datapathid" type="string"/>
					<parameter name="strjson" type="string"/>
					<parameter name="resourceid" type="string"/>
				</parameters>
				<container name="switchgroup" type="hashmap" keytype="string" valuetype="string"/>
				<variable name="sresourceid" type="string"/>
				<variable name="transportid" type="string"/>
				<set name="sresourceid" value="context.allocResourceId()"/>
				<!--qiulei modify 20170807-->
				<if cond="context.merterContainer.hasValue(context.datapathid.toString())==true">
					<then>
						<lookup name="merterContainer" key="context.datapathid.toString()" output="context.switchgroup"/>
					</then>
					<else>
						<insert name="merterContainer" key="context.datapathid.toString()" value="context.switchgroup"/>
					</else>
				</if>
				<insert name="switchgroup" key="context.sresourceid.toString()" value="context.strjson.toString()"/>
				<function name="GetTransportIdFromDevice" class="DeviceManager">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="transportid" type="string" out="context.transportid"/>
					</parameters>
				</function>
				<function name="Send_OFPT13_GROUP_MOD">
					
			<log>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  InstallGroupRequest   Send_OFPT13_GROUP_MOD  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</log>
					<parameters>
						<parameter name="transportid" type="string" in="context.transportid"/>
						<parameter name="strjson" type="string" in="context.modstrjson.toString()"/>
					</parameters>
				</function>
				<set name="resourceid" value="context.sresourceid.toString()"/>
			</function>
			<function name="UnInstallGroupRequest">
				<parameters>
					<parameter name="datapathid" type="string"/>
					<parameter name="resourceid" type="string"/>
				</parameters>
				<variable name="transportid" type="string"/>
				<container name="switchgroup" type="hashmap" keytype="string" valuetype="string"/>
				<variable name="flowmodjson" type="string"/>
				<variable name="sendflowmodjson" type="string"/>
				<if cond="context.merterContainer.hasValue(context.datapathid.toString()) ==true">
					<then>
						<function>
							<lookup name="merterContainer" key="context.datapathid.toString()" output="context.switchgroup"/>
						</function>
					</then>
					<else>
						<function>
							<log>UnInstallMeterRequest exit</log>
							<exit/>
						</function>
					</else>
				</if>
				<if cond="context.switchgroup.hasValue(context.resourceid.toString()) == true">
					<then>
						<function>
							<lookup name="switchgroup" key="context.resourceid.toString()" output="context.flowmodjson"/>
						</function>
					</then>
					<else>
						<function>
							<log>UnInstallMeterRequest exit2</log>
							<exit/>
						</function>
					</else>
				</if>
				<log><![CDATA[flowmodjson=<%=context.flowmodjson.toString()%>]]></log>
				<script><![CDATA[
						var info = JSON.parse(context.flowmodjson.toString());
						info.command='3';
						var strjson=JSON.stringify(info);
						context.sendflowmodjson.setValue(strjson);
				]]></script>
				<function name="GetTransportIdFromDevice" class="DeviceManager">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="transportid" type="string" out="context.transportid"/>
					</parameters>
				</function>
				<function name="Send_OFPT13_METER_MOD">
				
			<log>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  UnInstallGroupRequest   Send_OFPT13_GROUP_MOD  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@</log>
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="strjson" type="string" in="context.sendflowmodjson.toString()"/>
					</parameters>
				</function>
				<remove name="switchgroup" key="context.resourceid.toString()"/>
			</function>
			<!--
				OFPGT_ALL = 0, /* All (multicast/broadcast) group. */
				OFPGT_SELECT = 1, /* Select group. */
				OFPGT_INDIRECT = 2, /* Indirect group. */
				OFPGT_FF = 3, /* Fast failover group. */
			-->
			<function name="testaddgroup">			
				<parameters>
						<parameter name="datapathid" type="string"/>
				</parameters>
				<variable name="modstrjson" type="string"/>
				<variable name="returnresourceid" type="string"/>
				<reference variable="modstrjson">
					<jsonbody><![CDATA[ 
						{
							"xid":"<%=context.openflowserverobj.getIncreaseXID()%>",
							"command":"1",
							"grouptype":"1",
							"groupid":"1",
							"bucketlist":[
								{
									"weight":"1",
									"watchport":"1000",
									"watchgroup":"1000",
									"actions":[
										{
											"type":"0",
											"outport":"0xfffffffd",
											"maxlen":"0xffff"
										}
									]
								}
							]
						}	
					]]></jsonbody>
				</reference>
				<function name="InstallGroupRequest">
					<parameters>
						<parameter name="datapathid" type="string" in="context.datapathid"/>
						<parameter name="strjson" type="string" in="context.modstrjson.toString()"/>
						<parameter name="resourceid" type="string" out="returnresourceid"/>
					</parameters>
				</function>
				<log><![CDATA[testaddgroup returnresourceid=<%=context.returnresourceid.toString()%>]]></log>
				
			</function>
			<function name="testremovegroup">			
				<parameters>
					<parameter name="datapathid" type="string"/>
				</parameters>
				<function name="InstallGroupRequest">
					<parameters>
						<parameter name="resourceid" type="string" out="context.resourceid"/>
					</parameters>
				</function>
				<log><![CDATA[InstallFlowTableRequest resourceid=<%=context.resourceid.toString()%>]]></log>
				
			</function>
		</public>
	</class>
</starosxml>
{'fraction_non_alphanumeric': 0.19723323355715558, 'fraction_numerical': 0.007280964323274816, 'mean_word_length': 3.652615732028604, 'pattern_counts': {'":': 24, '<': 293, '<?xml version=': 2, '>': 293, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4091229', 'n_tokens_mistral': 5215, 'n_tokens_neox': 3830, 'n_words': 597}