mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
Delete code that is commented out
Change-Id: I3d346dd186b3ef55c25464f207ca687c842f5ddc
This commit is contained in:
parent
2b2e681f7e
commit
d94b477da1
@ -165,127 +165,4 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> {
|
|||||||
LinkResourceRequest request = builder.build();
|
LinkResourceRequest request = builder.build();
|
||||||
return request.resources().isEmpty() ? null : resourceService.requestResources(request);
|
return request.resources().isEmpty() ? null : resourceService.requestResources(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME refactor below this line... ----------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates the series of MatchActionOperations from the
|
|
||||||
* {@link FlowBatchOperation}.
|
|
||||||
* <p>
|
|
||||||
* FIXME: Currently supporting PacketPathFlow and SingleDstTreeFlow only.
|
|
||||||
* <p>
|
|
||||||
* FIXME: MatchActionOperations should have dependency field to the other
|
|
||||||
* match action operations, and this method should use this.
|
|
||||||
*
|
|
||||||
* @param op the {@link FlowBatchOperation} object
|
|
||||||
* @return the list of {@link MatchActionOperations} objects
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
private List<MatchActionOperations>
|
|
||||||
generateMatchActionOperationsList(FlowBatchOperation op) {
|
|
||||||
|
|
||||||
// MatchAction operations at head (ingress) switches.
|
|
||||||
MatchActionOperations headOps = matchActionService.createOperationsList();
|
|
||||||
|
|
||||||
// MatchAction operations at rest of the switches.
|
|
||||||
MatchActionOperations tailOps = matchActionService.createOperationsList();
|
|
||||||
|
|
||||||
MatchActionOperations removeOps = matchActionService.createOperationsList();
|
|
||||||
|
|
||||||
for (BatchOperationEntry<Operator, ?> e : op.getOperations()) {
|
|
||||||
|
|
||||||
if (e.getOperator() == FlowBatchOperation.Operator.ADD) {
|
|
||||||
generateInstallMatchActionOperations(e, tailOps, headOps);
|
|
||||||
} else if (e.getOperator() == FlowBatchOperation.Operator.REMOVE) {
|
|
||||||
generateRemoveMatchActionOperations(e, removeOps);
|
|
||||||
} else {
|
|
||||||
throw new UnsupportedOperationException(
|
|
||||||
"FlowManager supports ADD and REMOVE operations only.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return Arrays.asList(tailOps, headOps, removeOps);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates MatchActionOperations for an INSTALL FlowBatchOperation.
|
|
||||||
* <p/>
|
|
||||||
* FIXME: Currently only supports flows that generate exactly two match
|
|
||||||
* action operation sets.
|
|
||||||
*
|
|
||||||
* @param e Flow BatchOperationEntry
|
|
||||||
* @param tailOps MatchActionOperation set that the tail
|
|
||||||
* MatchActionOperations will be placed in
|
|
||||||
* @param headOps MatchActionOperation set that the head
|
|
||||||
* MatchActionOperations will be placed in
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
private void generateInstallMatchActionOperations(
|
|
||||||
BatchOperationEntry<Operator, ?> e,
|
|
||||||
MatchActionOperations tailOps,
|
|
||||||
MatchActionOperations headOps) {
|
|
||||||
|
|
||||||
if (!(e.getTarget() instanceof Flow)) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"The target is not Flow object: " + e.getTarget());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compile flows to match-actions
|
|
||||||
Flow flow = (Flow) e.getTarget();
|
|
||||||
List<MatchActionOperations> maOps = flow.compile(
|
|
||||||
e.getOperator(), matchActionService);
|
|
||||||
verifyNotNull(maOps, "Could not compile the flow: " + flow);
|
|
||||||
verify(maOps.size() == 2,
|
|
||||||
"The flow generates unspported match-action operations.");
|
|
||||||
|
|
||||||
// Map FlowId to MatchActionIds
|
|
||||||
for (MatchActionOperations maOp : maOps) {
|
|
||||||
for (MatchActionOperationEntry entry : maOp.getOperations()) {
|
|
||||||
flowMatchActionsMap.put(
|
|
||||||
KryoFactory.serialize(flow.getId()),
|
|
||||||
KryoFactory.serialize(entry.getTarget()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Merge match-action operations
|
|
||||||
for (MatchActionOperationEntry mae : maOps.get(0).getOperations()) {
|
|
||||||
verify(mae.getOperator() == MatchActionOperations.Operator.INSTALL);
|
|
||||||
tailOps.addOperation(mae);
|
|
||||||
}
|
|
||||||
for (MatchActionOperationEntry mae : maOps.get(1).getOperations()) {
|
|
||||||
verify(mae.getOperator() == MatchActionOperations.Operator.INSTALL);
|
|
||||||
headOps.addOperation(mae);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Generates MatchActionOperations for a REMOVE FlowBatchOperation.
|
|
||||||
*
|
|
||||||
* @param e Flow BatchOperationEntry
|
|
||||||
* @param removeOps MatchActionOperation set that the remove
|
|
||||||
* MatchActionOperations will be placed in
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
private void generateRemoveMatchActionOperations(
|
|
||||||
BatchOperationEntry<Operator, ?> e,
|
|
||||||
MatchActionOperations removeOps) {
|
|
||||||
|
|
||||||
if (!(e.getTarget() instanceof FlowId)) {
|
|
||||||
throw new IllegalStateException(
|
|
||||||
"The target is not a FlowId object: " + e.getTarget());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compile flows to match-actions
|
|
||||||
FlowId flowId = (FlowId) e.getTarget();
|
|
||||||
|
|
||||||
for (byte[] matchActionIdBytes :
|
|
||||||
flowMatchActionsMap.remove(KryoFactory.serialize(flowId))) {
|
|
||||||
MatchActionId matchActionId = KryoFactory.deserialize(matchActionIdBytes);
|
|
||||||
removeOps.addOperation(new MatchActionOperationEntry(
|
|
||||||
MatchActionOperations.Operator.REMOVE, matchActionId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user