public class DecayingFlags extends Object
keepalive to 7, and then you'd
schedule a thread to call sweep() once per day.
Now, flags that were toggled once will be set to low again
the next day, while flags that were extensively used will
take up to seven days before falling back to low.
Flags that are toggled at or more than once every day will
always be high.| Modifier and Type | Class and Description |
|---|---|
static class |
DecayingFlags.Key
A flag in the set, with a unique index pointing
to the bit that correlates to this flag.
|
| Constructor and Description |
|---|
DecayingFlags(int keepalive) |
| Modifier and Type | Method and Description |
|---|---|
String |
asHex() |
void |
flag(DecayingFlags.Key key) |
void |
sweep()
This is how decay happens, the interval at which
this method is called controls how long unused
flags are kept 'high'.
|
public DecayingFlags(int keepalive)
keepalive - controls the maximum length of time
a flag will stay toggled if it is not
renewed, expressed as the number of times
sweep() needs to be called.public void flag(DecayingFlags.Key key)
public void sweep()
public String asHex()
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.