water.parser
Class Enum
java.lang.Object
water.Iced
water.parser.Enum
- All Implemented Interfaces:
- java.lang.Cloneable, Freezable
public final class Enum
- extends Iced
- implements java.lang.Cloneable
Class for tracking enum columns.
Basically a wrapper around non blocking hash map.
In the first pass, we just collect set of unique strings per column
(if there are less than MAX_ENUM_SIZE unique elements).
After pass1, the keys are sorted and indexed alphabetically.
In the second pass, map is used only for lookup and never updated.
Enum objects are shared among threads on the local nodes!
Constructor Summary |
Enum()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MAX_ENUM_SIZE
public static final int MAX_ENUM_SIZE
- See Also:
- Constant Field Values
Enum
public Enum()
clone
public Enum clone()
- Overrides:
clone
in class Iced
addKey
public int addKey(ValueString str)
- Add key to this map (treated as hash set in this case).
All keys are added with value = 1.
- Parameters:
str
-
containsKey
public final boolean containsKey(java.lang.Object key)
addKey
public void addKey(java.lang.String str)
getTokenId
public int getTokenId(java.lang.String str)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
addedElems
public long addedElems()
getTokenId
public int getTokenId(ValueString str)
merge
public void merge(Enum other)
maxId
public int maxId()
size
public int size()
isKilled
public boolean isKilled()
kill
public void kill()
computeColumnDomain
public java.lang.String[] computeColumnDomain()
write
public AutoBuffer write(AutoBuffer ab)
- Description copied from interface:
Freezable
- Serialize the 'this' object into the AutoBuffer, returning the AutoBuffer.
- Specified by:
write
in interface Freezable
- Overrides:
write
in class Iced
read
public Enum read(AutoBuffer ab)
- Description copied from interface:
Freezable
- Deserialize from the AutoBuffer into a pre-existing 'this' object.
- Specified by:
read
in interface Freezable
- Overrides:
read
in class Iced