Hello all.

Still working on merging content.
But I have a doubt.


Class BinFiles.java
Function onTrigger.
Got a call to migrateBins when is scheduled.

Function migrateBins, first lines are :

> for (final Bin bin : binManager.removeReadyBins(true)) {
> this.readyBins.add(bin);
> added++;
> }



Class BinManager
Function removeReadyBins
There is a loop

> for (final Bin bin : group.getValue()) {
> if (relaxFullnessConstraint && (bin.isFullEnough() || bin.
> isOlderThan(maxBinAgeSeconds.get(), TimeUnit.SECONDS))) {
> readyBins.add(bin);
> } else if (!relaxFullnessConstraint && bin.isFull()) {
> readyBins.add(bin);
> } else {
> remainingBins.add(bin);
> }
> ...
>   }


 In this case relasFullnessConstraint is true, so check if bin is full or
OlderThan.

Class Bin
Function isOlderThan

> public boolean isOlderThan(final int duration, final TimeUnit unit) {
> final long ageInNanos = System.nanoTime() - creationMomentEpochNs;
> return ageInNanos > TimeUnit.NANOSECONDS.convert(duration, unit);
> }


So if I set 0 seconds for the max age, or keep it empty
This function will always return true.

So the bin can be considered as full but it is wrong.

First call, with fragement identifier --> FRAG1
Second call with fragement identifier --> FRAG2
But during the second call, the check for first bean will return true. It
is not fullEnough, but it is older than the "specify" max age.

Do you confirm than ?

If yes, this is expected behavior ?

Regards.

Etienne Jouvin

Reply via email to