public static BucketId getDefaultInstance(String defaultValue) { return new BucketId(Long.valueOf(defaultValue)); }
public BucketCounterBuilder setBucketId(BucketId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _bucketId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _bucketId_range)); } } this._bucketId = value; return this; } public static List<Range<BigInteger>> _bucketId_range() {
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } BucketCounterKey other = (BucketCounterKey) obj; if (_bucketId == null) { if (other._bucketId != null) { return false; } } else if(!_bucketId.equals(other._bucketId)) { return false; } return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bucketId == null) ? 0 : _bucketId.hashCode()); return result; }
@ConstructorProperties("value") public BucketId(java.lang.Long _value) { if (_value != null) { BigInteger _constraint = BigInteger.valueOf(_value); boolean isValidRange = false; for (Range<BigInteger> r : range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", _value, range())); } } Preconditions.checkNotNull(_value, "Supplied value may not be null"); this._value = _value; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bucketId == null) ? 0 : _bucketId.hashCode()); return result; }
private Buckets toSALBuckets(List<BucketStats> bucketStats) { BucketsBuilder salBuckets = new BucketsBuilder(); List<BucketCounter> allBucketStats = new ArrayList<>(); int bucketKey = 0; for (BucketStats bucketStat : bucketStats) { BucketCounterBuilder bucketCounter = new BucketCounterBuilder(); bucketCounter.setByteCount(new Counter64(bucketStat.getByteCount())); bucketCounter.setPacketCount(new Counter64(bucketStat.getPacketCount())); BucketId bucketId = new BucketId((long) bucketKey); bucketCounter.setKey(new BucketCounterKey(bucketId)); bucketCounter.setBucketId(bucketId); bucketKey++; allBucketStats.add(bucketCounter.build()); } salBuckets.setBucketCounter(allBucketStats); return salBuckets.build(); }
public BucketBuilder setBucketId(BucketId value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value.getValue()); boolean isValidRange = false; for (Range<BigInteger> r : _bucketId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _bucketId_range)); } } this._bucketId = value; return this; } public static List<Range<BigInteger>> _bucketId_range() {
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_action == null) ? 0 : _action.hashCode()); result = prime * result + ((_bucketId == null) ? 0 : _bucketId.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_watchGroup == null) ? 0 : _watchGroup.hashCode()); result = prime * result + ((_watchPort == null) ? 0 : _watchPort.hashCode()); result = prime * result + ((_weight == null) ? 0 : _weight.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } BucketKey other = (BucketKey) obj; if (_bucketId == null) { if (other._bucketId != null) { return false; } } else if(!_bucketId.equals(other._bucketId)) { return false; } return true; }
List<Action> bucketActionList = Lists.newArrayList(); BucketBuilder bucket = new BucketBuilder(); bucket.setBucketId(new BucketId((long) bucketId)); bucket.setKey(new BucketKey(new BucketId((long) bucketId))); bucketId++; bucket.setBucketId(new BucketId((long) 1)); bucket.setKey(new BucketKey(new BucketId((long) 1))); bucket.setAction(bucketActionList); bucketList.add(bucket.build());
private JsonArrayBuilder createBandStatsJsonArrayObject(List<BucketCounter> bucketCounters) { JsonArrayBuilder jsonArrayObject = factory.createArrayBuilder(); for (BucketCounter bucketCounter : bucketCounters) { jsonArrayObject.add(factory.createObjectBuilder() .add(properties.getProperty("BCK_ID"), bucketCounter.getBucketId().getValue()) .add(properties.getProperty("BYTE_COUNT"), bucketCounter.getByteCount().getValue()) .add(properties.getProperty("PACK_COUNT"), bucketCounter.getPacketCount().getValue()) .add(properties.getProperty("BCK_KEY"), bucketCounter.getKey().getBucketId().getValue())); } return jsonArrayObject; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_bucketId == null) ? 0 : _bucketId.hashCode()); result = prime * result + ((_byteCount == null) ? 0 : _byteCount.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_packetCount == null) ? 0 : _packetCount.hashCode()); result = prime * result + ((augmentation == null) ? 0 : augmentation.hashCode()); return result; }
return false; } else if(!_bucketId.equals(other.getBucketId())) { return false;
.setBucketId(new BucketId(grpID.longValue()));
return false; } else if(!_bucketId.equals(other.getBucketId())) { return false;
BucketsBuilder bucketBuilder = new BucketsBuilder(); BucketBuilder bucket = new BucketBuilder(); bucket.setBucketId(new BucketId((long) bucketId)); bucket.setKey(new BucketKey(new BucketId((long) bucketId))); bucketId++; List<Action> origbucketActions = origbucket.getAction(); BucketsBuilder bucketBuilder = new BucketsBuilder(); BucketBuilder bucket = new BucketBuilder(); bucket.setBucketId(new BucketId((long) bucketId)); bucket.setKey(new BucketKey(new BucketId((long) bucketId)));
bucketDesc.setWatchPort(bucketDetails.getWatchPort().getValue()); bucketDesc.setWatchGroup(bucketDetails.getWatchGroup()); BucketId bucketId = new BucketId((long) bucketKey); bucketDesc.setBucketId(bucketId); bucketDesc.setKey(new BucketKey(bucketId));