Class WeightedAliasTarget
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.dns.AliasTarget
-
- com.yahoo.vespa.hosted.controller.api.integration.dns.WeightedAliasTarget
-
public class WeightedAliasTarget extends AliasTarget
An implementation ofAliasTargetwhere is requests are answered based on the weight assigned to the record, as a proportion of the total weight for all records having the same DNS name. The portion of received traffic is calculated as follows: (record weight / sum of the weights of all records).- Author:
- mpolden
-
-
Constructor Summary
Constructors Constructor Description WeightedAliasTarget(com.yahoo.config.provision.HostName name, java.lang.String dnsZone, com.yahoo.config.provision.zone.ZoneId zone, long weight)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()RecordDatapack()Returns the fields in this encoded as record datajava.lang.StringtoString()static WeightedAliasTargetunpack(RecordData data)Unpack weighted alias from given record datalongweight()The weight of this target-
Methods inherited from class com.yahoo.vespa.hosted.controller.api.integration.dns.AliasTarget
dnsZone, id, name
-
-
-
-
Method Detail
-
weight
public long weight()
The weight of this target
-
pack
public RecordData pack()
Description copied from class:AliasTargetReturns the fields in this encoded as record data- Specified by:
packin classAliasTarget
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAliasTarget
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAliasTarget
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
unpack
public static WeightedAliasTarget unpack(RecordData data)
Unpack weighted alias from given record data
-
-