/** User call which empty local trash of vectors. */ protected final void emptyLTrash() { if (_lVecTrash.isEmpty()) return; Futures fs = new Futures(); cleanupTrash(_lVecTrash, fs); fs.blockForPending(); } /** Append all vectors from given frame to a global clean up list.
public static Key make(S3ObjectSummary obj) { Futures fs = new Futures(); Key key = make(obj, fs); fs.blockForPending(); return key; } public static Key make(S3ObjectSummary obj, Futures fs) {
/** Delete model trees */ public void delete_trees() { Futures fs = new Futures(); delete_trees(fs); fs.blockForPending(); } public Futures delete_trees(Futures fs) {
public static Key make(FileStatus f) { Futures fs = new Futures(); Key key = make(f, fs); fs.blockForPending(); return key; } public static Key make(FileStatus f, Futures fs) {
static public void put( Key key, Value val ) { Futures fs = new Futures(); put(key,val,fs); fs.blockForPending(); // Block for remote-put to complete } static public void put( Key key, Iced val, Futures fs ) { put(key,new Value(key, val),fs); }
Vec[] close() { Futures fs = new Futures(); Vec vs[] = new Vec[_avs.length]; for( int i=0; i<_avs.length; i++ ) vs[i] = _avs[i].close(fs); fs.blockForPending(); return vs; } }
public static Vec[] closeAll(AppendableVec [] avs) { Futures fs = new Futures(); Vec [] res = closeAll(avs,fs); fs.blockForPending(); return res; } public static Vec[] closeAll(AppendableVec [] avs, Futures fs) {
public void close() { Futures fs = new Futures(); _vec.close(fs); fs.blockForPending(); _vec.postWrite(); } }
@Override public FVecDataOut close(){ Futures fs = new Futures(); close(fs); fs.blockForPending(); return this; } public void check(){
public Frame outputFrame(Key key, String [] names, String [][] domains){ Futures fs = new Futures(); Frame res = outputFrame(key, names, domains, fs); fs.blockForPending(); return res; } public Frame outputFrame(Key key, String [] names, String [][] domains, Futures fs){
public boolean Next(Futures fs) throws IOException { if (_start_index < _rows_lst.size()) { if (_start_index + _batch_size > _rows_lst.size()) _start_index = _rows_lst.size() - _batch_size; // Multi-Threaded data preparation for (int i = 0; i < _batch_size; i++) fs.add(H2O.submitTask(new FrameDataConverter(i, _rows_lst.get(_start_index+i), _dinfo, _label_lst==null?-1:_label_lst.get(_start_index + i), _data[which()], _label[which()], _cache))); fs.blockForPending(); flip(); _start_index += _batch_size; return true; } else { return false; } }
public Frame subRef( Frame fr, String key ) { if( fr == null ) return null; Futures fs = new Futures(); for( Vec vec : fr.vecs() ) subRef(vec,fs); fs.blockForPending(); return null; } // Lower refcounts on all vecs captured in the inner environment
public T delete_and_lock( Key job_key ) { Lockable old = write_lock(job_key); if( old != null ) { Log.debug(Log.Tag.Sys.LOCKS,"lock-then-clear "+_key+" by job "+job_key); old.delete_impl(new Futures()).blockForPending(); } return (T)this; }
@Override protected void cleanup(){ super.cleanup(); if(toEnum && _srcDinfo != null){ Futures fs = new Futures(); _srcDinfo._adaptedFrame.lastVec().remove(fs); fs.blockForPending(); } } @Override protected boolean filterNaCols(){return true;}
private void cleanUpCache(Futures fs) { final Key[] cacheKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, DeepWaterImageIterator.IcedImage.class) && k._key.toString().contains(CACHE_MARKER) || Value.isSubclassOf(k._type, DeepWaterDatasetIterator.IcedRow.class) && k._key.toString().contains(CACHE_MARKER); } }).keys(); if (fs==null) fs = new Futures(); for (Key k : cacheKeys) DKV.remove(k, fs); fs.blockForPending(); }
@Override public void onCompletion(CountedCompleter caller) { int i = _cntr.incrementAndGet(); RebalanceTask rbt = (RebalanceTask)caller; Futures fs = new Futures(); for(Vec v:rbt._srcVecs) v.remove(fs); fs.blockForPending();; if(i < _newVecs.length) { new RebalanceTask(new Cmp(), _vecs[i]).asyncExec(_newVecs[i]); } } }
/** Set the element as missing the VERY slow way. */ public final boolean setNA( long i ) { Chunk ck = chunkForRow(i); boolean ret = ck.setNA(i); Futures fs = new Futures(); ck.close(ck.cidx(), fs); //slow to do this for every set -> use Writer if writing many values fs.blockForPending(); postWrite(); return ret; }
@Override protected Response serve() { Futures fs = new Futures(); for(Vec v:source.remove(cols)) v.remove(fs); DKV.put(source._key, source,fs); fs.blockForPending(); return Inspect2.redirect(this, source._key.toString()); } }
public void delete( Key job_key, float dummy ) { if( _key != null ) { Log.debug(Log.Tag.Sys.LOCKS,"lock-then-delete "+_key+" by job "+job_key); new PriorWriteLock(job_key).invoke(_key); } Futures fs = new Futures(); delete_impl(fs); if( _key != null ) DKV.remove(_key,fs); // Delete self also fs.blockForPending(); }
/** Create a new 1-element vector representing a scalar value. */ public static Vec make1Elem(Key key, double d) { assert key.isVec(); Vec v = new Vec(key,new long[]{0,1}); Futures fs = new Futures(); DKV.put(v.chunkKey(0),new C0DChunk(d,1),fs); DKV.put(key,v,fs); fs.blockForPending(); return v; }