From 3918f4ab3e8ae5deb5c93f5eaa5b38f53fde19f9 Mon Sep 17 00:00:00 2001 From: cotton-ben Date: Tue, 7 Jul 2020 06:20:43 -0400 Subject: [PATCH] fixed both transport=/dev/shm/ references for www.xsede.org java (hdf5) --- .../acid/revelations/DirtyReadOffender.java | 22 ++++++++++--------- .../acid/revelations/DirtyReadTolerance.java | 3 ++- .../acid/revelations/DirtyReadVictim.java | 5 +++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadOffender.java b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadOffender.java index 4d39564c2..99279c37e 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadOffender.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadOffender.java @@ -2,12 +2,13 @@ package net.openhft.chronicle.map.fromdocs.acid.revelations; import net.openhft.chronicle.map.ChronicleMap; import net.openhft.chronicle.map.fromdocs.BondVOInterface; + import java.util.Scanner; import java.util.concurrent.locks.StampedLock; import static net.openhft.chronicle.values.Values.newNativeReference; -public class DirtyReadOffender { +public class DirtyReadOffender { public static void main(String args[]) { Scanner sc = new Scanner(System.in); @@ -19,14 +20,15 @@ public class DirtyReadOffender { ChronicleMap chm = DirtyReadTolerance.offHeap( args[2] - +"OPERAND_CHRONICLE_MAP" + + "OPERAND_CHRONICLE_MAP" ); System.out.println( " @t=" + System.currentTimeMillis() + " DirtyReadOffender established chm " ); StampedLock offHeapLock = new ChronicleStampedLock( - "OPERAND_ChronicleStampedLock" + args[2] + + "OPERAND_ChronicleStampedLock" ); BondVOInterface bond = newNativeReference(BondVOInterface.class); //BondVOInterface cslMock = newNativeReference(BondVOInterface.class); @@ -34,7 +36,7 @@ public class DirtyReadOffender { //chm.acquireUsing("Offender ", cslMock); // mock ChronicleStampLock System.out.println( " @t=" + System.currentTimeMillis() + - " DirtyReadOffender sleeping "+sleepT+" seconds " + " DirtyReadOffender sleeping " + sleepT + " seconds " ); Thread.sleep(sleepT * 1_000); System.out.println( @@ -65,17 +67,17 @@ public class DirtyReadOffender { double newCoupon = 3.5 + Math.random(); System.out.println( " @t=" + System.currentTimeMillis() + - " DirtyReadOffender "+ - " calling chm.put('369604101',"+newCoupon+") " + " DirtyReadOffender " + + " calling chm.put('369604101'," + newCoupon + ") " ); bond.setCoupon(newCoupon); chm.put("369604101", bond); //cslMock.setEntryLockState(System.currentTimeMillis()); //mock'd - // chm.put("Offender ",cslMock); //mock'd + // chm.put("Offender ",cslMock); //mock'd System.out.println( " @t=" + System.currentTimeMillis() + - " DirtyReadOffender coupon=["+ - bond.getCoupon()+ + " DirtyReadOffender coupon=[" + + bond.getCoupon() + "] written. " ); } finally { @@ -83,7 +85,7 @@ public class DirtyReadOffender { System.out.println( " @t=" + System.currentTimeMillis() + " DirtyReadOffender called " + - "offHeapLock.unlockWrite("+stamp+");" + "offHeapLock.unlockWrite(" + stamp + ");" ); } /** diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadTolerance.java b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadTolerance.java index 51d658343..e21ba3a97 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadTolerance.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadTolerance.java @@ -20,7 +20,8 @@ public class DirtyReadTolerance { ChronicleMap chm = DirtyReadTolerance.offHeap( - "C:\\Users\\buddy\\dev\\shm\\OPERAND_CHRONICLE_MAP" + args[2] + + "OPERAND_CHRONICLE_MAP" ); System.out.println(",Established chm,"); diff --git a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadVictim.java b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadVictim.java index 9564910fd..c0f3bef64 100644 --- a/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadVictim.java +++ b/src/test/java/net/openhft/chronicle/map/fromdocs/acid/revelations/DirtyReadVictim.java @@ -20,7 +20,7 @@ public class DirtyReadVictim { ChronicleMap chm = DirtyReadTolerance.offHeap( args[2] - + "OPERAND_CHRONICLE_MAP" + + "OPERAND_CHRONICLE_MAP" ); Double coupon = 0.00; BondVOInterface bond = newNativeReference(BondVOInterface.class); @@ -32,7 +32,8 @@ public class DirtyReadVictim { ); StampedLock offHeapLock = new ChronicleStampedLock( - "OPERAND_ChronicleStampedLock" + args[2] + + "OPERAND_ChronicleStampedLock" ); while ((stamp = offHeapLock.tryOptimisticRead()) < 0) { ;