Package org.onosproject.net.group
Class DefaultGroupBucket
- java.lang.Object
- 
- org.onosproject.net.group.DefaultGroupBucket
 
- 
- All Implemented Interfaces:
- GroupBucket,- StoredGroupBucketEntry
 
 public final class DefaultGroupBucket extends Object implements GroupBucket, StoredGroupBucketEntry Group bucket implementation. A group bucket is collection of instructions that can be performed on a traffic flow. A select Group can have one or more Buckets where traffic will be processed by a single bucket in the group, based on device specific selection algorithm (e.g. hash on some fields of the incoming traffic flows or round robin) and hence can contains optional weight field to define the weights among the buckets in the group. A failover group bucket is associated with a specific port or group that controls its liveness.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longbytes()Returns the number of bytes processed by this group bucket.static GroupBucketcreateAllGroupBucket(TrafficTreatment treatment)Creates all group bucket.static GroupBucketcreateCloneGroupBucket(TrafficTreatment treatment)Creates clone group bucket.static GroupBucketcreateFailoverGroupBucket(TrafficTreatment treatment, PortNumber watchPort, GroupId watchGroup)Creates failover group bucket with watchport or watchgroup.static GroupBucketcreateIndirectGroupBucket(TrafficTreatment treatment)Creates indirect group bucket.static GroupBucketcreateSelectGroupBucket(TrafficTreatment treatment)Creates select group bucket with weight as 1.static GroupBucketcreateSelectGroupBucket(TrafficTreatment treatment, short weight)Creates select group bucket with specified weight.booleanequals(Object obj)inthashCode()booleanhasSameParameters(GroupBucket other)Returns whether the given group bucket has the same parameters (weight, watchPort and watchGroup) as this.longpackets()Returns the number of packets processed by this group bucket.voidsetBytes(long bytes)Sets number of bytes processed by this group bucket entry.voidsetPackets(long packets)Sets number of packets processed by this group bucket entry.StringtoString()TrafficTreatmenttreatment()Returns list of Traffic instructions that are part of the bucket.GroupDescription.Typetype()Returns group type of the bucket.GroupIdwatchGroup()Returns group identifier used for liveness detection for a failover bucket.PortNumberwatchPort()Returns port number used for liveness detection for a failover bucket.shortweight()Returns weight of select group bucket.
 
- 
- 
- 
Method Detail- 
createIndirectGroupBucketpublic static GroupBucket createIndirectGroupBucket(TrafficTreatment treatment) Creates indirect group bucket.- Parameters:
- treatment- traffic treatment associated with group bucket
- Returns:
- indirect group bucket object
 
 - 
createSelectGroupBucketpublic static GroupBucket createSelectGroupBucket(TrafficTreatment treatment) Creates select group bucket with weight as 1.- Parameters:
- treatment- traffic treatment associated with group bucket
- Returns:
- select group bucket object
 
 - 
createSelectGroupBucketpublic static GroupBucket createSelectGroupBucket(TrafficTreatment treatment, short weight) Creates select group bucket with specified weight.- Parameters:
- treatment- traffic treatment associated with group bucket
- weight- weight associated with group bucket
- Returns:
- select group bucket object
 
 - 
createFailoverGroupBucketpublic static GroupBucket createFailoverGroupBucket(TrafficTreatment treatment, PortNumber watchPort, GroupId watchGroup) Creates failover group bucket with watchport or watchgroup.- Parameters:
- treatment- traffic treatment associated with group bucket
- watchPort- port that determines the liveness of group bucket
- watchGroup- group that determines the liveness of group bucket
- Returns:
- failover group bucket object
 
 - 
createAllGroupBucketpublic static GroupBucket createAllGroupBucket(TrafficTreatment treatment) Creates all group bucket.- Parameters:
- treatment- traffic treatment associated with group bucket
- Returns:
- all group bucket object
 
 - 
createCloneGroupBucketpublic static GroupBucket createCloneGroupBucket(TrafficTreatment treatment) Creates clone group bucket.- Parameters:
- treatment- traffic treatment associated with group bucket
- Returns:
- clone group bucket object
 
 - 
typepublic GroupDescription.Type type() Description copied from interface:GroupBucketReturns group type of the bucket.- Specified by:
- typein interface- GroupBucket
- Returns:
- GroupType group type
 
 - 
treatmentpublic TrafficTreatment treatment() Returns list of Traffic instructions that are part of the bucket.- Specified by:
- treatmentin interface- GroupBucket
- Returns:
- TrafficTreatment Traffic instruction list
 
 - 
weightpublic short weight() Returns weight of select group bucket.- Specified by:
- weightin interface- GroupBucket
- Returns:
- short weight associated with a bucket
 
 - 
watchPortpublic PortNumber watchPort() Returns port number used for liveness detection for a failover bucket.- Specified by:
- watchPortin interface- GroupBucket
- Returns:
- PortNumber port number used for liveness detection
 
 - 
watchGrouppublic GroupId watchGroup() Returns group identifier used for liveness detection for a failover bucket.- Specified by:
- watchGroupin interface- GroupBucket
- Returns:
- GroupId group identifier to be used for liveness detection
 
 - 
hasSameParameterspublic boolean hasSameParameters(GroupBucket other) Description copied from interface:GroupBucketReturns whether the given group bucket has the same parameters (weight, watchPort and watchGroup) as this.- Specified by:
- hasSameParametersin interface- GroupBucket
- Parameters:
- other- group bucket to compare
- Returns:
- true if this bucket has the same parameters as other, false otherwise
 
 - 
packetspublic long packets() Description copied from interface:GroupBucketReturns the number of packets processed by this group bucket.- Specified by:
- packetsin interface- GroupBucket
- Returns:
- number of packets
 
 - 
bytespublic long bytes() Description copied from interface:GroupBucketReturns the number of bytes processed by this group bucket.- Specified by:
- bytesin interface- GroupBucket
- Returns:
- number of bytes
 
 - 
setPacketspublic void setPackets(long packets) Description copied from interface:StoredGroupBucketEntrySets number of packets processed by this group bucket entry.- Specified by:
- setPacketsin interface- StoredGroupBucketEntry
- Parameters:
- packets- a long value
 
 - 
setBytespublic void setBytes(long bytes) Description copied from interface:StoredGroupBucketEntrySets number of bytes processed by this group bucket entry.- Specified by:
- setBytesin interface- StoredGroupBucketEntry
- Parameters:
- bytes- a long value
 
 
- 
 
-