Class AbstractDistributedP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>
- java.lang.Object
-
- org.onosproject.drivers.p4runtime.mirror.AbstractDistributedP4RuntimeMirror<H,E>
-
- Type Parameters:
H- handle classE- entry class
- All Implemented Interfaces:
P4RuntimeMirror<H,E>
- Direct Known Subclasses:
DistributedP4RuntimeActionProfileGroupMirror,DistributedP4RuntimeActionProfileMemberMirror,DistributedP4RuntimeDefaultEntryMirror,DistributedP4RuntimeMeterMirror,DistributedP4RuntimePreEntryMirror,DistributedP4RuntimeTableMirror
@Beta public abstract class AbstractDistributedP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity> extends java.lang.Object implements P4RuntimeMirror<H,E>
Abstract implementation of a distributed P4Runtime mirror, backed by anEventuallyConsistentMap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractDistributedP4RuntimeMirror.InternalPipeconfWatchdogListener
-
Field Summary
Fields Modifier and Type Field Description protected org.onosproject.net.pi.service.PiPipeconfWatchdogServicepipeconfWatchdogServiceprotected org.onosproject.store.service.StorageServicestorageService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()org.onosproject.net.Annotationsannotations(H handle)Returns annotations associated to the given handle, if present, otherwise null.voidapplyWriteRequest(org.onosproject.p4runtime.api.P4RuntimeWriteClient.WriteRequest request)Uses the given P4Runtime write request to update the state of this mirror by optimistically assuming that all updates in it will succeed.voidapplyWriteResponse(org.onosproject.p4runtime.api.P4RuntimeWriteClient.WriteResponse response)Uses the given P4Runtime write response to update the state of this mirror.voiddeactivate()TimedEntry<E>get(H handle)Returns entry associated to the given handle, if present, otherwise null.java.util.Collection<TimedEntry<E>>getAll(org.onosproject.net.DeviceId deviceId)Returns all entries for the given device ID.voidput(H handle, E entry)Stores the given entry associating it to the given handle.voidputAnnotations(H handle, org.onosproject.net.Annotations annotations)Stores the given annotations associating it to the given handle.voidremove(H handle)Removes the entry associated to the given handle.voidsync(org.onosproject.net.DeviceId deviceId, java.util.Collection<E> entities)Synchronizes the state of the given device ID with the given collection of PI entities.
-
-
-
Method Detail
-
activate
public void activate()
-
deactivate
public void deactivate()
-
getAll
public java.util.Collection<TimedEntry<E>> getAll(org.onosproject.net.DeviceId deviceId)
Description copied from interface:P4RuntimeMirrorReturns all entries for the given device ID.- Specified by:
getAllin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
deviceId- device ID- Returns:
- collection of table entries
-
get
public TimedEntry<E> get(H handle)
Description copied from interface:P4RuntimeMirrorReturns entry associated to the given handle, if present, otherwise null.- Specified by:
getin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
handle- handle- Returns:
- PI table entry
-
put
public void put(H handle, E entry)
Description copied from interface:P4RuntimeMirrorStores the given entry associating it to the given handle.- Specified by:
putin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
handle- handleentry- entry
-
remove
public void remove(H handle)
Description copied from interface:P4RuntimeMirrorRemoves the entry associated to the given handle.- Specified by:
removein interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
handle- handle
-
putAnnotations
public void putAnnotations(H handle, org.onosproject.net.Annotations annotations)
Description copied from interface:P4RuntimeMirrorStores the given annotations associating it to the given handle.- Specified by:
putAnnotationsin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
handle- handleannotations- entry
-
annotations
public org.onosproject.net.Annotations annotations(H handle)
Description copied from interface:P4RuntimeMirrorReturns annotations associated to the given handle, if present, otherwise null.- Specified by:
annotationsin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
handle- handle- Returns:
- PI table annotations
-
sync
public void sync(org.onosproject.net.DeviceId deviceId, java.util.Collection<E> entities)Description copied from interface:P4RuntimeMirrorSynchronizes the state of the given device ID with the given collection of PI entities.- Specified by:
syncin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
deviceId- device IDentities- collection of PI entities
-
applyWriteRequest
public void applyWriteRequest(org.onosproject.p4runtime.api.P4RuntimeWriteClient.WriteRequest request)
Description copied from interface:P4RuntimeMirrorUses the given P4Runtime write request to update the state of this mirror by optimistically assuming that all updates in it will succeed.- Specified by:
applyWriteRequestin interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
request- P4Runtime write request
-
applyWriteResponse
public void applyWriteResponse(org.onosproject.p4runtime.api.P4RuntimeWriteClient.WriteResponse response)
Description copied from interface:P4RuntimeMirrorUses the given P4Runtime write response to update the state of this mirror.- Specified by:
applyWriteResponsein interfaceP4RuntimeMirror<H extends org.onosproject.net.pi.runtime.PiHandle,E extends org.onosproject.net.pi.runtime.PiEntity>- Parameters:
response- P4Runtime write response
-
-