public ICommitRecord getRandomCommitRecord() { final long timestamp = System.currentTimeMillis(); // using the clock for this as well so that it is an ascending value. final long commitCounter = System.currentTimeMillis(); final int n = ICommitRecord.MAX_ROOT_ADDRS; long[] roots = new long[n]; for(int i=0; i<n; i++) { boolean empty = r.nextInt(100)<30; roots[i] = empty ? 0L : r.nextInt(Integer.MAX_VALUE); } return new CommitRecord(timestamp,commitCounter,roots); }
public ICommitRecord getRandomCommitRecord() { final long timestamp = System.currentTimeMillis(); // using the clock for this as well so that it is an ascending value. final long commitCounter = System.currentTimeMillis(); final int n = ICommitRecord.MAX_ROOT_ADDRS; long[] roots = new long[n]; for(int i=0; i<n; i++) { boolean empty = r.nextInt(100)<30; roots[i] = empty ? 0L : r.nextInt(Integer.MAX_VALUE); } return new CommitRecord(timestamp,commitCounter,roots); }
return new CommitRecord(timestamp,commitCounter,roots);
return new CommitRecord(timestamp,commitCounter,roots);
/** * Return the commit record, either new or read from the root block. */ private ICommitRecord _getCommitRecord() { assert _fieldReadWriteLock.writeLock().isHeldByCurrentThread(); // the address of the current commit record from the root block. final long commitRecordAddr = _rootBlock.getCommitRecordAddr(); if (log.isInfoEnabled()) log.info("Reading commit record from: " + commitRecordAddr); if (commitRecordAddr == NULL) { // No commit record on the store yet. return new CommitRecord(); } else { // Read the commit record from the store. return CommitRecordSerializer.INSTANCE.deserialize(_bufferStrategy .read(commitRecordAddr)); } }
/** * Return the commit record, either new or read from the root block. */ private ICommitRecord _getCommitRecord() { assert _fieldReadWriteLock.writeLock().isHeldByCurrentThread(); // the address of the current commit record from the root block. final long commitRecordAddr = _rootBlock.getCommitRecordAddr(); if (log.isInfoEnabled()) log.info("Reading commit record from: " + commitRecordAddr); if (commitRecordAddr == NULL) { // No commit record on the store yet. return new CommitRecord(); } else { // Read the commit record from the store. return CommitRecordSerializer.INSTANCE.deserialize(_bufferStrategy .read(commitRecordAddr)); } }
final ICommitRecord commitRecord = new CommitRecord(commitTime, newCommitCounter, rootAddrs);
final ICommitRecord commitRecord = new CommitRecord(commitTime, newCommitCounter, rootAddrs);