public final class DefaultGroupBucket extends java.lang.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(java.lang.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.
|
java.lang.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()
GroupBucket
type
in interface GroupBucket
public TrafficTreatment treatment()
treatment
in interface GroupBucket
public short weight()
weight
in interface GroupBucket
public PortNumber watchPort()
watchPort
in interface GroupBucket
public GroupId watchGroup()
watchGroup
in interface GroupBucket
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean hasSameParameters(GroupBucket other)
GroupBucket
hasSameParameters
in interface GroupBucket
other
- group bucket to comparepublic java.lang.String toString()
toString
in class java.lang.Object
public long packets()
GroupBucket
packets
in interface GroupBucket
public long bytes()
GroupBucket
bytes
in interface GroupBucket
public void setPackets(long packets)
StoredGroupBucketEntry
setPackets
in interface StoredGroupBucketEntry
packets
- a long valuepublic void setBytes(long bytes)
StoredGroupBucketEntry
setBytes
in interface StoredGroupBucketEntry
bytes
- a long value