/** Finds a job with given key or returns null. * * @param jobkey job key * @return returns a job with given job key or null if a job is not found. */ public static Job findJob(final Key jobkey) { return UKV.get(jobkey); }
@Override public void onCompletion(CountedCompleter cc) { _v._domain = _dom; UKV.put(_v._key,_v); } }
@Override public Value getValue( Object key ) { return UKV.getValue((Key)key); } @Override public byte[] getBytes( Object val ) { return ((Value)val).memOrLoad(); }
@Override public float progress() { ParseProgress progress = UKV.get(_progress); if( progress == null || progress._total == 0 ) return 0; return progress._value / (float) progress._total; } @Override public void remove() {
/** Delete all vectors in given trash. */ private void cleanupTrash(HashSet<Key> trash, Futures fs) { for (Key k : trash) UKV.remove(k, fs); } }
@Override public void put( Object key, Object val ) { UKV.put((Key)key,(Value)val); } @Override public Value getValue( Object key ) { return UKV.getValue((Key)key); }
@Override protected final void setupLocal() { int ntrees = _treeKeys.length; _trees = new CompressedTree[ntrees][]; for (int t=0; t<ntrees; t++) { Key[] treek = _treeKeys[t]; _trees[t] = new CompressedTree[treek.length]; // FIXME remove get by introducing fetch class for all trees for (int i=0; i<treek.length; i++) { if (treek[i]!=null) _trees[t][i] = UKV.get(treek[i]); } } }
/** Actually remove/delete all Vecs from memory, not just from the Frame. */ @Override public Futures delete_impl(Futures fs) { for( Key k : _keys ) UKV.remove(k,fs); _names = new String[0]; _vecs = new Vec[0]; _keys = new Key[0]; return fs; } @Override public String errStr() { return "Dataset"; }
/** Save this tree into DKV store under the given Key. */ public Key save(Key k) { CompressedTree ts = compress(); UKV.put(k, ts); return k; }
@Override public void compute2() { Lockable l = UKV.get(_key); _producer = l!=null && l._lockers!=null && l._lockers.length > 0 ? l._lockers[0] : null; tryComplete(); } @Override public byte priority() { return H2O.ATOMIC_PRIORITY; }
@Override public void close() { super.close(); if( _toClose != null ) UKV.remove(_toClose._key); } }
static public void put( Key key, Iced val, Futures fs ) { put(key,new Value(key, val),fs); } // Do the DKV.put. DISALLOW this interface for Lockables. Lockables all
/** Return progress of this job. * * @return the value in interval <0,1> representing job progress. */ public float progress() { Freezable f = UKV.get(destination_key); if( f instanceof Progress ) return ((Progress) f).progress(); return 0; }
@Override public void postGlobal() { super.postGlobal(); _outerMFPT._dout[_outerMFPT._lo] = _dout; _dout = null; // Reclaim GC eagerly if(_removeKey != null) UKV.remove(_removeKey); } }
static public void put(String s, Value v) { put(Key.make(s), v); } static public void remove(String s) { remove(Key.make(s)); }