public boolean isFrame(){ return _type == TypeMap.onIce(Frame.class.getName()); } public boolean isLockable(){
@Override public int frozenType() { return _frozen$type == 0 ? (_frozen$type=water.TypeMap.onIce(IcedArrayList.class.getName())) : _frozen$type; } @Override public AutoBuffer writeJSONFields(AutoBuffer bb) {
@Override public int frozenType() { return _frozen$type == 0 ? (_frozen$type=water.TypeMap.onIce(IcedHashMap.class.getName())) : _frozen$type; } @Override public AutoBuffer writeJSONFields(AutoBuffer bb) { return bb; }
@Override public void compute2() { _id = TypeMap.onIce(_clazz); tryComplete(); } @Override public byte priority() { return H2O.FETCH_ACK_PRIORITY; }
protected boolean matchesType(H2O.KeyInfo ki) { // No type filtering if( _typeid == 0 && _cname == null ) return true; // One-shot monotonic racey update from 0 to the known fixed typeid. // Since all writers write the same typeid, there is no race. if( _typeid == 0 ) _typeid = TypeMap.onIce(_cname); if( ki._type == _typeid ) return true; // Class Model is abstract, and TypeMap clazz() does not handle that well. // Also, want to allow both OldModel & Model. // Hack: check for water.Model and name the class directly. Class kclz = TypeMap.clazz(ki._type); if( TypeMap.className(_typeid).equals("water.Model") ) return Model.class.isAssignableFrom(kclz); return TypeMap.clazz(_typeid).isAssignableFrom(kclz); }
public <T extends Iced> Map<String, T> fetchAll(Class<T> c, boolean exact, int offset, int limit) { TreeMap<String, T> res = new TreeMap<String, T>(); final int typeId = TypeMap.onIce(c.getName()); for (KeyInfo kinfo : _keyInfos) { if (kinfo._type == typeId || (!exact && c.isAssignableFrom(TypeMap.clazz(kinfo._type)))) { if (offset > 0) { --offset; continue; } Value v = DKV.get(kinfo._key); if (v != null) { T t = v.get(); res.put(kinfo._key.toString(), t); if (res.size() == limit) break; } } } return res; } public static KeySnapshot localSnapshot(){return localSnapshot(false);}