public final class DefaultGroupBucket extends Object implements GroupBucket, StoredGroupBucketEntry
| Modifier and Type | Method and Description |
|---|---|
long |
bytes()
Returns the number of bytes processed by this group bucket.
|
static GroupBucket |
createAllGroupBucket(TrafficTreatment treatment)
Creates all group bucket.
|
static GroupBucket |
createFailoverGroupBucket(TrafficTreatment treatment,
PortNumber watchPort,
GroupId watchGroup)
Creates failover group bucket with watchport or watchgroup.
|
static GroupBucket |
createIndirectGroupBucket(TrafficTreatment treatment)
Creates indirect group bucket.
|
static GroupBucket |
createSelectGroupBucket(TrafficTreatment treatment)
Creates select group bucket with weight as 1.
|
static GroupBucket |
createSelectGroupBucket(TrafficTreatment treatment,
short weight)
Creates select group bucket with specified weight.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
hasSameParameters(GroupBucket other)
Returns whether the given group bucket has the same parameters (weight,
watchPort and watchGroup) as this.
|
long |
packets()
Returns the number of packets processed by this group bucket.
|
void |
setBytes(long bytes)
Sets number of bytes processed by this group bucket entry.
|
void |
setPackets(long packets)
Sets number of packets processed by this group bucket entry.
|
String |
toString() |
TrafficTreatment |
treatment()
Returns list of Traffic instructions that are part of the bucket.
|
GroupDescription.Type |
type()
Returns group type of the bucket.
|
GroupId |
watchGroup()
Returns group identifier used for liveness detection for a
failover bucket.
|
PortNumber |
watchPort()
Returns port number used for liveness detection for a
failover bucket.
|
short |
weight()
Returns weight of select group bucket.
|
public static GroupBucket createIndirectGroupBucket(TrafficTreatment treatment)
treatment - traffic treatment associated with group bucketpublic static GroupBucket createSelectGroupBucket(TrafficTreatment treatment)
treatment - traffic treatment associated with group bucketpublic static GroupBucket createSelectGroupBucket(TrafficTreatment treatment, short weight)
treatment - traffic treatment associated with group bucketweight - weight associated with group bucketpublic static GroupBucket createFailoverGroupBucket(TrafficTreatment treatment, PortNumber watchPort, GroupId watchGroup)
treatment - traffic treatment associated with group bucketwatchPort - port that determines the liveness of group bucketwatchGroup - group that determines the liveness of group bucketpublic static GroupBucket createAllGroupBucket(TrafficTreatment treatment)
treatment - traffic treatment associated with group bucketpublic GroupDescription.Type type()
GroupBuckettype in interface GroupBucketpublic TrafficTreatment treatment()
treatment in interface GroupBucketpublic short weight()
weight in interface GroupBucketpublic PortNumber watchPort()
watchPort in interface GroupBucketpublic GroupId watchGroup()
watchGroup in interface GroupBucketpublic boolean hasSameParameters(GroupBucket other)
GroupBuckethasSameParameters in interface GroupBucketother - group bucket to comparepublic long packets()
GroupBucketpackets in interface GroupBucketpublic long bytes()
GroupBucketbytes in interface GroupBucketpublic void setPackets(long packets)
StoredGroupBucketEntrysetPackets in interface StoredGroupBucketEntrypackets - a long valuepublic void setBytes(long bytes)
StoredGroupBucketEntrysetBytes in interface StoredGroupBucketEntrybytes - a long value