@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("tableinfo(").append(this.tableInfo != null).append(")."); sb.append(getClass().getSimpleName()).append('@') .append(Integer.toHexString(System.identityHashCode(this))).append("="); SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object valBytes = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { RegionEntryUtils.entryKeyString(this.getKeyBytes(), valBytes, this.tableInfo, sb); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(valBytes); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("tableinfo(").append(this.tableInfo != null).append(")."); sb.append(getClass().getSimpleName()).append('@') .append(Integer.toHexString(System.identityHashCode(this))).append("="); SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object valBytes = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { RegionEntryUtils.entryKeyString(this.getKeyBytes(), valBytes, this.tableInfo, sb); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(valBytes); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("tableinfo(").append(this.tableInfo != null).append(")."); sb.append(getClass().getSimpleName()).append('@') .append(Integer.toHexString(System.identityHashCode(this))).append("="); SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object valBytes = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { RegionEntryUtils.entryKeyString(this.getKeyBytes(), valBytes, this.tableInfo, sb); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(valBytes); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } return sb.toString(); }
/** * Just like {@link #release(Object)} but also disable debug tracking of the release. * @return true if release was done */ public static boolean releaseWithNoTracking(@Released Object o) { if (o instanceof Chunk) { SimpleMemoryAllocatorImpl.skipRefCountTracking(); ((Chunk) o).release(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); return true; } else { return false; } }
public final byte[] getValueBytes() { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); if (vbs != null) { if (vbs.getClass() == byte[].class) { return (byte[])vbs; } else { final OffHeapByteSource ohbytes = (OffHeapByteSource)vbs; try { return ohbytes.getRowBytes(); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); ohbytes.release(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } } } else { return null; } }
public final byte[] getValueBytes() { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); if (vbs != null) { if (vbs.getClass() == byte[].class) { return (byte[])vbs; } else { final OffHeapByteSource ohbytes = (OffHeapByteSource)vbs; try { return ohbytes.getRowBytes(); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); ohbytes.release(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } } } else { return null; } }
public final byte[] getValueBytes() { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); if (vbs != null) { if (vbs.getClass() == byte[].class) { return (byte[])vbs; } else { final OffHeapByteSource ohbytes = (OffHeapByteSource)vbs; try { return ohbytes.getRowBytes(); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); ohbytes.release(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } } } else { return null; } }
public final void setKeyColumn(final DataValueDescriptor dvd, final int index) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entrySetKeyColumn(dvd, this.getKeyBytes(), vbs, this.tableInfo, index)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } // false return value indicates retry if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils .checkCacheForNullKeyValue("CompactCompositeKey#getKeyColumn(int)"); }
public final void getKeyColumns(final DataValueDescriptor[] keys) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entryKeyColumns(this.getKeyBytes(), vbs, this.tableInfo, keys)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils.checkCacheForNullKeyValue( "CompactCompositeKey#getKeyColumns(DataValueDescriptor[])"); }
public final DataValueDescriptor getKeyColumn(final int index) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); final DataValueDescriptor dvd; try { dvd = RegionEntryUtils.entryKeyColumn(this.getKeyBytes(), vbs, this.tableInfo, index); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } if (dvd != null) { return dvd; } if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils .checkCacheForNullKeyValue("CompactCompositeKey#getKeyColumn(int)"); }
public final void getKeyColumns(final DataValueDescriptor[] keys) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entryKeyColumns(this.getKeyBytes(), vbs, this.tableInfo, keys)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils.checkCacheForNullKeyValue( "CompactCompositeKey#getKeyColumns(DataValueDescriptor[])"); }
public final DataValueDescriptor getKeyColumn(final int index) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); final DataValueDescriptor dvd; try { dvd = RegionEntryUtils.entryKeyColumn(this.getKeyBytes(), vbs, this.tableInfo, index); } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } if (dvd != null) { return dvd; } if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils .checkCacheForNullKeyValue("CompactCompositeKey#getKeyColumn(int)"); }
public final void getKeyColumns(final DataValueDescriptor[] keys) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entryKeyColumns(this.getKeyBytes(), vbs, this.tableInfo, keys)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils.checkCacheForNullKeyValue( "CompactCompositeKey#getKeyColumns(DataValueDescriptor[])"); }
public final void setKeyColumn(final DataValueDescriptor dvd, final int index) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entrySetKeyColumn(dvd, this.getKeyBytes(), vbs, this.tableInfo, index)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } // false return value indicates retry if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils .checkCacheForNullKeyValue("CompactCompositeKey#getKeyColumn(int)"); }
public final void setKeyColumn(final DataValueDescriptor dvd, final int index) { int tries = 1; do { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released final Object vbs = getValueByteSource(); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (RegionEntryUtils.entrySetKeyColumn(dvd, this.getKeyBytes(), vbs, this.tableInfo, index)) { return; } } finally { SimpleMemoryAllocatorImpl.skipRefCountTracking(); this.releaseValueByteSource(vbs); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); } // false return value indicates retry if ((tries % MAX_TRIES_YIELD) == 0) { // enough tries; give other threads a chance to proceed Thread.yield(); } } while (tries++ <= MAX_TRIES); throw RegionEntryUtils .checkCacheForNullKeyValue("CompactCompositeKey#getKeyColumn(int)"); }
public static Object getHeapRowForInVMValue(OffHeapRegionEntry re) { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released Object val = RegionEntryUtils .convertOffHeapEntrytoByteSourceRetain(re, null, false, true); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (val instanceof OffHeapByteSource) { return ((OffHeapByteSource)val).getValueAsDeserializedHeapObject(); } else { return val; } } finally { OffHeapHelper.releaseWithNoTracking(val); } }
/** @return false if entry doesn't exist */ public final boolean setOldValueFromRegion() { try { RegionEntry re = this.region.getRegionEntry(getKey()); if (re == null) return false; SimpleMemoryAllocatorImpl.skipRefCountTracking(); Object v = re._getValueRetain(this.region, true); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { return setOldValue(v); } finally { OffHeapHelper.releaseWithNoTracking(v); } } catch (EntryNotFoundException ex) { return false; } }
public static Object getHeapRowForInVMValue(OffHeapRegionEntry re) { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released Object val = RegionEntryUtils .convertOffHeapEntrytoByteSourceRetain(re, null, false, true); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (val instanceof OffHeapByteSource) { return ((OffHeapByteSource)val).getValueAsDeserializedHeapObject(); } else { return val; } } finally { OffHeapHelper.releaseWithNoTracking(val); } }
public static Object getHeapRowForInVMValue(OffHeapRegionEntry re) { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released Object val = RegionEntryUtils .convertOffHeapEntrytoByteSourceRetain(re, null, false, true); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (val instanceof OffHeapByteSource) { return ((OffHeapByteSource)val).getValueAsDeserializedHeapObject(); } else { return val; } } finally { OffHeapHelper.releaseWithNoTracking(val); } }
private boolean satisfiesExpectedOldValue(EntryEventImpl event, RegionEntry re, Object expectedOldValue, boolean replaceOnClient) { // replace is propagated to server, so no need to check // satisfiesOldValue on client if (expectedOldValue != null && !replaceOnClient) { SimpleMemoryAllocatorImpl.skipRefCountTracking(); @Retained @Released Object v = re._getValueRetain(event.getLocalRegion(), true); SimpleMemoryAllocatorImpl.unskipRefCountTracking(); try { if (!AbstractRegionEntry.checkExpectedOldValue(expectedOldValue, v)) { return false; } } finally { OffHeapHelper.releaseWithNoTracking(v); } } return true; }