water.fvec
Class AppendableVec

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

public class AppendableVec
extends Vec

A NEW single distributed vector column. The NEW vector has no data, and takes no space. It supports distributed parallel writes to it, via calls to append2. Such writes happen in parallel and all writes are ordered. Writes *will* be local to the node doing them, specifically to allow control over locality. By default, writes will go local-homed chunks with no compression; there is a final 'close' to the NEW vector which may do compression; the final 'close' will return some other Vec type. NEW Vectors do NOT support reads!


Nested Class Summary
 
Nested classes/interfaces inherited from class water.fvec.Vec
Vec.CollectDomain, Vec.VectorGroup
 
Field Summary
static byte ENUM
           
static byte NA
           
static byte NUMBER
           
 
Fields inherited from class water.fvec.Vec
_domain, _key, LOG_CHK
 
Constructor Summary
AppendableVec(Key key)
           
AppendableVec(java.lang.String keyName)
           
 
Method Summary
 long byteSize()
          Size of compressed vector data.
 long chunk2StartElem(int cidx)
          Convert a chunk-index into a starting row #.
 Value chunkIdx(int cidx)
          Get a Chunk's Value by index.
 Vec close(Futures fs)
           
 Chunk elem2BV(int cidx)
          The Chunk for a chunk#.
 long get(long i)
           
 double getd(long i)
           
 long length()
          Number of elements in the vector.
 int nChunks()
          Number of chunks.
 boolean readable()
          Default read/write behavior for Vecs.
 void reduce(AppendableVec nv)
           
 java.lang.String toString()
          Pretty print the Vec: [#elems, min/mean/max]{chunks,...}
 boolean writable()
          Default read/write behavior for Vecs.
 
Methods inherited from class water.fvec.Vec
adaptTo, asEnum, at, at8, chunk, chunkKey, chunkLen, defaultLevels, domain, domain, group, isEnum, isInt, isNA, makeCon, makeCon, makeTransf, makeTransf, makeZero, max, mean, min, naCnt, postWrite, remove, rollupStats, rollupStats, rollupStats, set, set, set, setNA, sigma, toEnum
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUMBER

public static final byte NUMBER
See Also:
Constant Field Values

ENUM

public static final byte ENUM
See Also:
Constant Field Values

NA

public static final byte NA
See Also:
Constant Field Values
Constructor Detail

AppendableVec

public AppendableVec(java.lang.String keyName)

AppendableVec

public AppendableVec(Key key)
Method Detail

reduce

public void reduce(AppendableVec nv)

close

public Vec close(Futures fs)

readable

public boolean readable()
Description copied from class: Vec
Default read/write behavior for Vecs. File-backed Vecs are read-only.

Overrides:
readable in class Vec

writable

public boolean writable()
Description copied from class: Vec
Default read/write behavior for Vecs. AppendableVecs are write-only.

Overrides:
writable in class Vec

elem2BV

public Chunk elem2BV(int cidx)
Description copied from class: Vec
The Chunk for a chunk#. Warning: this loads the data locally!

Overrides:
elem2BV in class Vec

chunkIdx

public Value chunkIdx(int cidx)
Description copied from class: Vec
Get a Chunk's Value by index. Basically the index-to-key map, plus the DKV.get. Warning: this pulls the data locally; using this call on every Chunk index on the same node will probably trigger an OOM!

Overrides:
chunkIdx in class Vec

length

public long length()
Description copied from class: Vec
Number of elements in the vector. Overridden by subclasses that compute length in an alternative way, such as file-backed Vecs.

Overrides:
length in class Vec

nChunks

public int nChunks()
Description copied from class: Vec
Number of chunks. Overridden by subclasses that compute chunks in an alternative way, such as file-backed Vecs.

Overrides:
nChunks in class Vec

chunk2StartElem

public long chunk2StartElem(int cidx)
Description copied from class: Vec
Convert a chunk-index into a starting row #. For constant-sized chunks this is a little shift-and-add math. For variable-sized chunks this is a table lookup.

Overrides:
chunk2StartElem in class Vec

get

public long get(long i)

getd

public double getd(long i)

byteSize

public long byteSize()
Description copied from class: Vec
Size of compressed vector data.

Overrides:
byteSize in class Vec

toString

public java.lang.String toString()
Description copied from class: Vec
Pretty print the Vec: [#elems, min/mean/max]{chunks,...}

Overrides:
toString in class Vec