/** * Return the size in bytes for a given bucket. * * @param bucketId * @return size in bytes */ public long getBucketSize(int bucketId) { // This is an approximate calculation, so we don't require the // bucket to be fully initialized... // getInitializedBucketForId(Long.valueOf(bucketId)); // wait for the bucket to finish initializing final BucketRegion bucketRegion = this.localBucket2RegionMap .get(Integer.valueOf(bucketId)); if(bucketRegion == null) { return 0; } return bucketRegion.getTotalBytes(); }
/** * Return the size in bytes for a given bucket. * * @param bucketId * @return size in bytes */ public long getBucketSize(int bucketId) { // This is an approximate calculation, so we don't require the // bucket to be fully initialized... // getInitializedBucketForId(Long.valueOf(bucketId)); // wait for the bucket to finish initializing final BucketRegion bucketRegion = this.localBucket2RegionMap .get(Integer.valueOf(bucketId)); if(bucketRegion == null) { return 0; } return bucketRegion.getTotalBytes(); }
public void run() { PartitionedRegion region = (PartitionedRegion) getCache().getRegion("region1"); PartitionedRegionDataStore dataStore = region.getDataStore(); for(int i =1; i <= 6; i++) { BucketRegion bucket = dataStore.getLocalBucketById(i); assertEquals(1, bucket.getNumOverflowOnDisk()); assertEquals(0, bucket.getNumEntriesInVM()); //the size recorded on disk is not the same is the in memory size, apparently assertTrue("Bucket size was " + bucket.getNumOverflowBytesOnDisk(), 1 < bucket.getNumOverflowBytesOnDisk()); assertEquals(bucket.getNumOverflowBytesOnDisk(), bucket.getTotalBytes()); } } });
public Object call() { PartitionedRegion region = (PartitionedRegion) getCache().getRegion("region1"); PartitionedRegionDataStore dataStore = region.getDataStore(); long[] bucketSizes = new long[7]; for(int i =1; i <= 6; i++) { BucketRegion bucket = dataStore.getLocalBucketById(i); bucketSizes[i] = bucket.getTotalBytes(); assertEquals(0, bucket.getNumOverflowBytesOnDisk()); assertEquals(0, bucket.getNumOverflowOnDisk()); assertEquals(1, bucket.getNumEntriesInVM()); } getCache().close(); return bucketSizes; } });
public final boolean checkForColumnBatchCreation(TXStateInterface tx) { final PartitionedRegion pr = getPartitionedRegion(); return pr.isRowBuffer() && (tx == null || !tx.getProxy().isColumnRolloverDisabled()) && (getRegionSize() >= pr.getColumnMaxDeltaRows() || getTotalBytes() >= pr.getColumnBatchSize()); }
map.put("BucketId", br.getId()); map.put("Size", br.size()); map.put("Bytes", br.getTotalBytes()); InternalDistributedMember m = pr.getBucketPrimary(br.getId()); if (m.getId().equals(member.getId())) {
sizeOfRegion += constantOverhead + br.getTotalBytes(); entryCount += br.entryCount();