water.fvec
Class Vec.VectorGroup

java.lang.Object
  extended by water.Iced
      extended by water.fvec.Vec.VectorGroup
All Implemented Interfaces:
java.lang.Cloneable, Freezable
Enclosing class:
Vec

public static class Vec.VectorGroup
extends Iced

Class representing the group of vectors. Vectors from the same group have same distribution of chunks among nodes. Each vector is member of exactly one group. Default group of one vector is created for each vector. Group of each vector can be retrieved by calling group() method; The expected mode of operation is that user wants to add new vectors matching the source. E.g. parse creates several vectors (one for each column) which are all colocated and are colocated with the original bytevector. To do this, user should first ask for the set of keys for the new vectors by calling addVecs method on the target group. Vectors in the group will have the same keys except for the prefix which specifies index of the vector inside the group. The only information the group object carries is it's own key and the number of vectors it contains(deleted vectors still count). Because vectors(and chunks) share the same key-pattern with the group, default group with only one vector does not have to be actually created, it is implicit.


Constructor Summary
Vec.VectorGroup()
           
 
Method Summary
 Key[] addVecs(int n)
          Gets the next n keys of this group.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 int reserveKeys(int n)
           
 java.lang.String toString()
           
 Key vecKey(int vecId)
           
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Vec.VectorGroup

public Vec.VectorGroup()
Method Detail

vecKey

public Key vecKey(int vecId)

reserveKeys

public int reserveKeys(int n)

addVecs

public Key[] addVecs(int n)
Gets the next n keys of this group. Performs atomic udpate of the group object to assure we get unique keys. The group size will be udpated by adding n.

Parameters:
n -
Returns:
arrays of unique keys belonging to this group.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object