public class DeviceFlowTable
extends java.lang.Object
Flows in the table are stored in buckets. Each bucket is mutated and replicated as a single unit. The device flow table performs communication independent of other device flow tables for more parallelism.
This implementation uses several different replication protocols. Changes that occur on the device master are
replicated to the backups provided in the DeviceReplicaInfo for the master's term. Additionally, a periodic
anti-entropy protocol is used to detect missing flows on backups (e.g. due to a node restart). Finally, when a
device mastership change occurs, the new master synchronizes flows with the prior master and/or backups for the
device, allowing mastership to be reassigned to non-backup nodes.
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.lang.Void> |
add(org.onosproject.net.flow.FlowEntry rule)
Adds an entry to the table.
|
void |
close()
Closes the device flow table.
|
int |
count()
Counts the flows in the table.
|
java.util.Set<org.onosproject.net.flow.FlowEntry> |
getFlowEntries()
Returns the set of flow entries in the table.
|
org.onosproject.net.flow.StoredFlowEntry |
getFlowEntry(org.onosproject.net.flow.FlowRule rule)
Returns the flow entry for the given rule.
|
java.util.concurrent.CompletableFuture<org.onosproject.net.flow.FlowEntry> |
remove(org.onosproject.net.flow.FlowEntry rule)
Removes an entry from the table.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
update(org.onosproject.net.flow.FlowEntry rule)
Updates an entry in the table.
|
<T> java.util.concurrent.CompletableFuture<T> |
update(org.onosproject.net.flow.FlowRule rule,
java.util.function.Function<org.onosproject.net.flow.StoredFlowEntry,T> function)
Applies the given update function to the rule.
|
public int count()
public org.onosproject.net.flow.StoredFlowEntry getFlowEntry(org.onosproject.net.flow.FlowRule rule)
rule - the rule for which to lookup the flow entrypublic java.util.Set<org.onosproject.net.flow.FlowEntry> getFlowEntries()
public java.util.concurrent.CompletableFuture<java.lang.Void> add(org.onosproject.net.flow.FlowEntry rule)
rule - the rule to addpublic java.util.concurrent.CompletableFuture<java.lang.Void> update(org.onosproject.net.flow.FlowEntry rule)
rule - the rule to updatepublic <T> java.util.concurrent.CompletableFuture<T> update(org.onosproject.net.flow.FlowRule rule,
java.util.function.Function<org.onosproject.net.flow.StoredFlowEntry,T> function)
T - the result typerule - the rule to updatefunction - the update function to applynull if the rule was not updatedpublic java.util.concurrent.CompletableFuture<org.onosproject.net.flow.FlowEntry> remove(org.onosproject.net.flow.FlowEntry rule)
rule - the rule to removepublic void close()