/** * Returns localMaxMemory that must not be a temporary placeholder for offHeapLocalMaxMemory if * off-heap. This must return the true final value of localMaxMemory which requires the * DistributedSystem to be created if off-heap. See bug #52003. * * @throws IllegalStateException if off-heap and the actual value is not yet known (because the * DistributedSystem has not yet been created) * @see #getLocalMaxMemoryForValidation() */ public int getLocalMaxMemory() { if (this.offHeap && !this.localMaxMemoryExists) { int value = computeOffHeapLocalMaxMemory(); if (this.localMaxMemoryExists) { // real value now exists so set it and return this.localMaxMemory = value; } } checkLocalMaxMemoryExists(); return this.localMaxMemory; }
/** * @throws IllegalStateException if off-heap and the actual value is not yet known (because the * DistributedSystem has not yet been created) */ public void toData(DataOutput out) throws IOException { checkLocalMaxMemoryExists(); out.writeInt(this.redundancy); out.writeLong(this.totalMaxMemory); out.writeInt( getLocalMaxMemory()); // call the gettor to force it to be computed in the offheap case out.writeInt(this.totalNumBuckets); DataSerializer.writeString(this.colocatedRegionName, out); DataSerializer.writeObject(this.localProperties, out); DataSerializer.writeObject(this.globalProperties, out); out.writeLong(this.recoveryDelay); out.writeLong(this.startupRecoveryDelay); DataSerializer.writeObject(this.fixedPAttrs, out); }