/** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(ObjectType elementType, CachePerfStats stats) { this(stats); setElementType(elementType); }
/** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(ObjectType elementType, int initialCapacity, CachePerfStats stats) { this(initialCapacity, stats); setElementType(elementType); }
/** * @param stats the CachePerfStats to track hash collisions. Should be null unless this is used as * a query execution-time result set. */ ResultsBag(SelectResults sr, CachePerfStats stats) { this((Collection) sr, stats); // grab type info setElementType(sr.getCollectionType().getElementType()); }
rbWithoutData.setElementType(elementType); // avoid NPE in equals checkRoundTrip(rbWithoutData); ResultsBag rbWithData = new ResultsBag(data, (CachePerfStats) null); rbWithData.setElementType(elementType); // avoid NPE in equals checkRoundTrip(rbWithData);
public DummyQRegion(Region region) { super(region, false); Class constraint = region.getAttributes().getValueConstraint(); if (constraint != null) valueType = TypeUtils.getObjectType(constraint); constraint = region.getAttributes().getKeyConstraint(); if (constraint != null) keyType = TypeUtils.getObjectType(constraint); values = new ResultsBag(((HasCachePerfStats) region.getCache()).getCachePerfStats()); values.setElementType(valueType); keys = new ResultsSet(); keys.setElementType(keyType); entries = new ResultsSet(); // gets key and value types from region entries.setElementType(TypeUtils.getRegionEntryType(region)); }
@Override public SelectResults getValues() { if (values == null) { values = new ResultsBag(((HasCachePerfStats) getRegion().getCache()).getCachePerfStats()); values.setElementType(valueType); } values.clear(); Object val = this.entry.getValueOffHeapOrDiskWithoutFaultIn((LocalRegion) getRegion()); if (val instanceof StoredObject) { @Retained @Released StoredObject ohval = (StoredObject) val; try { val = ohval.getDeserializedValue(getRegion(), this.entry); } finally { ohval.release(); } } else if (val instanceof CachedDeserializable) { val = ((CachedDeserializable) val).getDeserializedValue(getRegion(), this.entry); } values.add(val); return values; }