Delete code that is commented out
Change-Id: I3d346dd186b3ef55c25464f207ca687c842f5ddc
Showing
1 changed file
with
0 additions
and
123 deletions
... | @@ -165,127 +165,4 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> { | ... | @@ -165,127 +165,4 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> { |
165 | LinkResourceRequest request = builder.build(); | 165 | LinkResourceRequest request = builder.build(); |
166 | return request.resources().isEmpty() ? null : resourceService.requestResources(request); | 166 | return request.resources().isEmpty() ? null : resourceService.requestResources(request); |
167 | } | 167 | } |
168 | - | ||
169 | - // FIXME refactor below this line... ---------------------------- | ||
170 | - | ||
171 | - /** | ||
172 | - * Generates the series of MatchActionOperations from the | ||
173 | - * {@link FlowBatchOperation}. | ||
174 | - * <p> | ||
175 | - * FIXME: Currently supporting PacketPathFlow and SingleDstTreeFlow only. | ||
176 | - * <p> | ||
177 | - * FIXME: MatchActionOperations should have dependency field to the other | ||
178 | - * match action operations, and this method should use this. | ||
179 | - * | ||
180 | - * @param op the {@link FlowBatchOperation} object | ||
181 | - * @return the list of {@link MatchActionOperations} objects | ||
182 | - */ | ||
183 | - /* | ||
184 | - private List<MatchActionOperations> | ||
185 | - generateMatchActionOperationsList(FlowBatchOperation op) { | ||
186 | - | ||
187 | - // MatchAction operations at head (ingress) switches. | ||
188 | - MatchActionOperations headOps = matchActionService.createOperationsList(); | ||
189 | - | ||
190 | - // MatchAction operations at rest of the switches. | ||
191 | - MatchActionOperations tailOps = matchActionService.createOperationsList(); | ||
192 | - | ||
193 | - MatchActionOperations removeOps = matchActionService.createOperationsList(); | ||
194 | - | ||
195 | - for (BatchOperationEntry<Operator, ?> e : op.getOperations()) { | ||
196 | - | ||
197 | - if (e.getOperator() == FlowBatchOperation.Operator.ADD) { | ||
198 | - generateInstallMatchActionOperations(e, tailOps, headOps); | ||
199 | - } else if (e.getOperator() == FlowBatchOperation.Operator.REMOVE) { | ||
200 | - generateRemoveMatchActionOperations(e, removeOps); | ||
201 | - } else { | ||
202 | - throw new UnsupportedOperationException( | ||
203 | - "FlowManager supports ADD and REMOVE operations only."); | ||
204 | - } | ||
205 | - | ||
206 | - } | ||
207 | - | ||
208 | - return Arrays.asList(tailOps, headOps, removeOps); | ||
209 | - } | ||
210 | - */ | ||
211 | - | ||
212 | - /** | ||
213 | - * Generates MatchActionOperations for an INSTALL FlowBatchOperation. | ||
214 | - * <p/> | ||
215 | - * FIXME: Currently only supports flows that generate exactly two match | ||
216 | - * action operation sets. | ||
217 | - * | ||
218 | - * @param e Flow BatchOperationEntry | ||
219 | - * @param tailOps MatchActionOperation set that the tail | ||
220 | - * MatchActionOperations will be placed in | ||
221 | - * @param headOps MatchActionOperation set that the head | ||
222 | - * MatchActionOperations will be placed in | ||
223 | - */ | ||
224 | - /* | ||
225 | - private void generateInstallMatchActionOperations( | ||
226 | - BatchOperationEntry<Operator, ?> e, | ||
227 | - MatchActionOperations tailOps, | ||
228 | - MatchActionOperations headOps) { | ||
229 | - | ||
230 | - if (!(e.getTarget() instanceof Flow)) { | ||
231 | - throw new IllegalStateException( | ||
232 | - "The target is not Flow object: " + e.getTarget()); | ||
233 | - } | ||
234 | - | ||
235 | - // Compile flows to match-actions | ||
236 | - Flow flow = (Flow) e.getTarget(); | ||
237 | - List<MatchActionOperations> maOps = flow.compile( | ||
238 | - e.getOperator(), matchActionService); | ||
239 | - verifyNotNull(maOps, "Could not compile the flow: " + flow); | ||
240 | - verify(maOps.size() == 2, | ||
241 | - "The flow generates unspported match-action operations."); | ||
242 | - | ||
243 | - // Map FlowId to MatchActionIds | ||
244 | - for (MatchActionOperations maOp : maOps) { | ||
245 | - for (MatchActionOperationEntry entry : maOp.getOperations()) { | ||
246 | - flowMatchActionsMap.put( | ||
247 | - KryoFactory.serialize(flow.getId()), | ||
248 | - KryoFactory.serialize(entry.getTarget())); | ||
249 | - } | ||
250 | - } | ||
251 | - | ||
252 | - // Merge match-action operations | ||
253 | - for (MatchActionOperationEntry mae : maOps.get(0).getOperations()) { | ||
254 | - verify(mae.getOperator() == MatchActionOperations.Operator.INSTALL); | ||
255 | - tailOps.addOperation(mae); | ||
256 | - } | ||
257 | - for (MatchActionOperationEntry mae : maOps.get(1).getOperations()) { | ||
258 | - verify(mae.getOperator() == MatchActionOperations.Operator.INSTALL); | ||
259 | - headOps.addOperation(mae); | ||
260 | - } | ||
261 | - } | ||
262 | - */ | ||
263 | - /** | ||
264 | - * Generates MatchActionOperations for a REMOVE FlowBatchOperation. | ||
265 | - * | ||
266 | - * @param e Flow BatchOperationEntry | ||
267 | - * @param removeOps MatchActionOperation set that the remove | ||
268 | - * MatchActionOperations will be placed in | ||
269 | - */ | ||
270 | - /* | ||
271 | - private void generateRemoveMatchActionOperations( | ||
272 | - BatchOperationEntry<Operator, ?> e, | ||
273 | - MatchActionOperations removeOps) { | ||
274 | - | ||
275 | - if (!(e.getTarget() instanceof FlowId)) { | ||
276 | - throw new IllegalStateException( | ||
277 | - "The target is not a FlowId object: " + e.getTarget()); | ||
278 | - } | ||
279 | - | ||
280 | - // Compile flows to match-actions | ||
281 | - FlowId flowId = (FlowId) e.getTarget(); | ||
282 | - | ||
283 | - for (byte[] matchActionIdBytes : | ||
284 | - flowMatchActionsMap.remove(KryoFactory.serialize(flowId))) { | ||
285 | - MatchActionId matchActionId = KryoFactory.deserialize(matchActionIdBytes); | ||
286 | - removeOps.addOperation(new MatchActionOperationEntry( | ||
287 | - MatchActionOperations.Operator.REMOVE, matchActionId)); | ||
288 | - } | ||
289 | - } | ||
290 | - */ | ||
291 | } | 168 | } | ... | ... |
-
Please register or login to post a comment