/** * This method returns true if Region is Empty. */ public boolean isEmpty() { //checkForNoAccess(); // size does this check return this.size() > 0 ? false : true; }
/** * This method returns true if Region is Empty. */ public boolean isEmpty() { //checkForNoAccess(); // size does this check return this.size() > 0 ? false : true; }
@Override public int size() { return this.region.size(); }
@Override public int size() { return this.region.size(); }
@Override public int size() { return this.region.size(); }
public void run() { long count = CCRegion.getTombstoneCount(); assertEquals("expected all tombstones to be expired", 0, count); assertEquals(numEntries, CCRegion.size()); } });
public Object call() { for (int i=0; i<10; i++) { TestRegion.invalidate("Object"+i, Integer.valueOf(i)); } assertEquals(10, TestRegion.size()); return null; } });
public void run() { long count = CCRegion.getTombstoneCount(); assertEquals("expected zero tombstones", 0, count); assertEquals("expected "+numEntries+" afterCreates", numEntries, afterCreates); assertEquals(numEntries, CCRegion.size()); // make sure the actual removal of the tombstones by the sweeper doesn't mess // up anything try { Thread.sleep(TombstoneService.REPLICATED_TOMBSTONE_TIMEOUT + 5000); } catch (InterruptedException e) { fail("sleep was interrupted"); } count = CCRegion.getTombstoneCount(); assertEquals("expected zero tombstones", 0, count); assertEquals(numEntries, CCRegion.size()); } });
public Object call() { Cache cache = getCache(); LocalRegion region = (LocalRegion)cache.getRegion(regionName); return region.size(); } };
public Object call() { Cache cache = getCache(); LocalRegion region = (LocalRegion)cache.getRegion(regionName); return region.size(); } };
public Object call() { for (int i=0; i<10; i++) { TestRegion.destroy("Object"+i, Integer.valueOf(i)); } assertEquals(0, TestRegion.size()); if (TestRegion.getDataPolicy().isReplicate()) { assertEquals(10, TestRegion.getTombstoneCount()); } return null; } });
@Override public void visit(Integer bucketId, Region buk) { try { LocalRegion lbuk = (LocalRegion)buk; lbuk.waitForData(); int size = lbuk.size(); int keySetSize = (new HashSet(lbuk.keySet())).size(); if (size != keySetSize) { if (logger.isDebugEnabled()) { logger.debug("Size is not consistent with keySet size! size={} but keySet size={} region={}", size, keySetSize, lbuk); } } lbuk.dumpBackingMap(); } catch (CacheRuntimeException ignore) {} } });
@Override protected boolean operateOnRegion(DistributionManager dm, LocalRegion r,long startTime) throws RemoteOperationException { int size = 0; if (r != null) { // bug #43372 - NPE returned when bucket not found during tx replay if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("{} operateOnRegion: {}", getClass().getName(), r.getFullPath()); } size = r.size(); } SizeReplyMessage.send(getSender(), getProcessorId(), dm, size); return false; }
/** test hook - dump the backing map for this region */ public void dumpBackingMap() { Object sync = TombstoneService.DEBUG_TOMBSTONE_COUNT? TombstoneService.debugSync : new Object(); synchronized(this.entries) { synchronized(sync) { if (this.entries instanceof AbstractRegionMap) { ((AbstractRegionMap)(this.entries)).verifyTombstoneCount(this.tombstoneCount); } logger.debug("Dumping region of size {} tombstones: {}: {}", size(), getTombstoneCount(), this.toString()); if (this.entries instanceof AbstractRegionMap) { ((AbstractRegionMap)this.entries).dumpMap(); } } } }
@Override public void visit(Integer bucketId, Region buk) { try { LocalRegion lbuk = (LocalRegion)buk; lbuk.waitForData(); int size = lbuk.size(); int keySetSize = (new HashSet(lbuk.keySet())).size(); if (size != keySetSize) { getLogWriter().info(LocalizedStrings.DEBUG, "Size is not consistent with keySet size! size=" + size + " but keySet size="+keySetSize + " region=" + lbuk); } lbuk.dumpBackingMap(); } catch (CacheRuntimeException ignore) {} } });
public void run() { try { for (int i=0; i<numEntries; i++) { CCRegion.create("cckey" + i, i); } long count = CCRegion.getTombstoneCount(); assertEquals("expected zero tombstones", 0, count); assertEquals("expected "+numEntries+" afterCreates", numEntries, afterCreates); assertEquals(numEntries, CCRegion.size()); if (CCRegion.getScope().isDistributedNoAck()) { sendSerialMessageToAll(); // flush the ops } } catch (CacheException e) { fail("while performing create operations", e); } } });
/** test hook - dump the backing map for this region */ public void dumpBackingMap() { Object sync = TombstoneService.DEBUG_TOMBSTONE_COUNT? TombstoneService.debugSync : new Object(); synchronized(this.entries) { synchronized(sync) { if (this.entries instanceof AbstractRegionMap) { ((AbstractRegionMap)(this.entries)).verifyTombstoneCount(this.tombstoneCount); } getLogWriterI18n().info(LocalizedStrings.DEBUG, "Dumping region of size " + size() + " tombstones: " + getTombstoneCount() + ": " + this.toString()); if (this.entries instanceof AbstractRegionMap) { ((AbstractRegionMap)this.entries).dumpMap(getLogWriterI18n()); } // ((UnsharedImageState)this.imageState).dumpDestroyedEntryKeys(getLogWriterI18n()); } } }
public void initNumRows(LocalRegion r) { if (r.getPartitionAttributes() != null) { // get the sizes from individual buckets final PartitionedRegion pr = (PartitionedRegion)r; if (pr.getDataStore() != null) { if (pr.isHDFSReadWriteRegion()) { this.previousNumRows = -1; } else { this.previousNumRows = pr.entryCountEstimate(null, pr.getDataStore() .getAllLocalBucketIds(), false); } } } else { this.previousNumRows = r.size(); } if (r.getConcurrencyChecksEnabled()) { SanityManager.DEBUG_PRINT("info:" + GfxdConstants.TRACE_CONGLOM, "Concurrency checks enabled for table " + getQualifiedTableName()); } }
public void initNumRows(LocalRegion r) { if (r.getPartitionAttributes() != null) { // get the sizes from individual buckets final PartitionedRegion pr = (PartitionedRegion)r; if (pr.getDataStore() != null) { if (pr.isHDFSReadWriteRegion()) { this.previousNumRows = -1; } else { this.previousNumRows = pr.entryCountEstimate(null, pr.getDataStore() .getAllLocalBucketIds(), false); } } } else { this.previousNumRows = r.size(); } if (r.getConcurrencyChecksEnabled()) { SanityManager.DEBUG_PRINT("info:" + GfxdConstants.TRACE_CONGLOM, "Concurrency checks enabled for table " + getQualifiedTableName()); } }
public final int getTotalNumRows(final LanguageConnectionContext lcc) throws StandardException { final DataPolicy policy = this.regionAttributes.getDataPolicy(); if (policy.withPartitioning() || this.regionAttributes.getScope().isLocal() || policy.withStorage()) { return this.region.size(); } else if (policy.withReplication() || !policy.withStorage()) { final RegionSizeMessage rmsg = new RegionSizeMessage( this.region.getFullPath(), new GfxdSingleResultCollector(), this.region, null, lcc); try { Object result = rmsg.executeFunction(); assert result instanceof Integer; return ((Integer)result).intValue(); } catch (SQLException sqle) { throw Misc.wrapRemoteSQLException(sqle, sqle, null); } } else { throw GemFireXDRuntimeException.newRuntimeException("Unknown region type: " + this.region, null); } }