tsc.useUnsafe(USE_UNSAFE);
IntIndexedChronicle tsc2 = new IntIndexedChronicle(basePath2);
tsc2.useUnsafe(USE_UNSAFE);
tsc.clear();
AffinityLock al = AffinityLock.acquireLock(false);
final AffinityLock al2 = al.acquireLock(AffinityStrategies.SAME_SOCKET, AffinityStrategies.DIFFERENT_CORE);
Thread t = new Thread(new Runnable() {
@Override
public void run() {
al2.bind();
try {
StringBuilder sb = new StringBuilder();
final IntIndexedChronicle tsc = new IntIndexedChronicle(basePath);
tsc.useUnsafe(USE_UNSAFE);
final IntIndexedChronicle tsc2 = new IntIndexedChronicle(basePath2);
tsc2.useUnsafe(USE_UNSAFE);
tsc2.clear();
Excerpt excerpt = tsc.createExcerpt();
Excerpt excerpt2 = tsc2.createExcerpt();
for (int i = 0; i < RUNS; i++) {
do {
BusyWaiter.pause();
} while (!excerpt.index(i));
char type = excerpt.readChar();
if ('T' != type)
assertEquals('T', type);
int n = excerpt.readInt();
if (i != n)
assertEquals(i, n);
excerpt.readChars(sb);
excerpt.readLong();
excerpt.readDouble();
excerpt.finish();
excerpt2.startExcerpt(6);
excerpt2.writeChar('R');
excerpt2.writeInt(n);
excerpt2.finish();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
al2.release();
}
}
});
t.start();