@Override public void writeRootBlock(IRootBlockView rootBlock, ForceEnum forceOnCommitEnum) { if (rootBlock.isRootBlock0()) { m_rb0 = rootBlock; } else { m_rb1 = rootBlock; } }
@Override public void writeRootBlock(IRootBlockView rootBlock, ForceEnum forceOnCommitEnum) { if (rootBlock.isRootBlock0()) { m_rb0 = rootBlock; } else { m_rb1 = rootBlock; } }
public void writeRootBlock(final IRootBlockView rootBlock, final ForceEnum forceOnCommit) { if (rootBlock == null) throw new IllegalArgumentException(); currentRootBlock = rootBlock.isRootBlock0() ? 0 : 1; rootBlocks[currentRootBlock] = rootBlock; }
public void writeRootBlock(final IRootBlockView rootBlock, final ForceEnum forceOnCommit) { if (rootBlock == null) throw new IllegalArgumentException(); currentRootBlock = rootBlock.isRootBlock0() ? 0 : 1; rootBlocks[currentRootBlock] = rootBlock; }
@Override public String toString() { return super.toString() + "{"// + "isRootBlock0=" + rootBlock.isRootBlock0()// + ", rootBlock=" + rootBlock// + ", consensusReleaseTime=" + consensusReleaseTime// + ", gatherJoinedAndNonJoinedServices=" + gatherJoinedAndNonJoinedServices// + ", prepareJoinedAndNonJoinedServices=" + prepareJoinedAndNonJoinedServices // + ", timeout=" + timeout// + ", unit=" + unit // + "}"; }
@Override public String toString() { return super.toString() + "{"// + "isRootBlock0=" + rootBlock.isRootBlock0()// + ", rootBlock=" + rootBlock// + ", consensusReleaseTime=" + consensusReleaseTime// + ", gatherJoinedAndNonJoinedServices=" + gatherJoinedAndNonJoinedServices// + ", prepareJoinedAndNonJoinedServices=" + prepareJoinedAndNonJoinedServices // + ", timeout=" + timeout// + ", unit=" + unit // + "}"; }
public HASnapshotResponse(final IRootBlockView rootBlock) { if (rootBlock == null) throw new IllegalArgumentException(); this.isRootBlock0 = rootBlock.isRootBlock0(); this.data = BytesUtil.toArray(rootBlock.asReadOnlyBuffer()); }
public HALogRootBlocksResponse(final IRootBlockView openRootBlock, final IRootBlockView closeRootBlock) { if (openRootBlock == null) throw new IllegalArgumentException(); if (closeRootBlock == null) throw new IllegalArgumentException(); this.openIsRootBlock0 = openRootBlock.isRootBlock0(); this.closeIsRootBlock0 = closeRootBlock.isRootBlock0(); this.openData = BytesUtil.toArray(openRootBlock.asReadOnlyBuffer()); this.closeData = BytesUtil.toArray(closeRootBlock.asReadOnlyBuffer()); }
public HARootBlockResponse(final IRootBlockView rootBlock) { if (rootBlock == null) throw new IllegalArgumentException(); this.isRootBlock0 = rootBlock.isRootBlock0(); this.data = BytesUtil.toArray(rootBlock.asReadOnlyBuffer()); }
public HASnapshotResponse(final IRootBlockView rootBlock) { if (rootBlock == null) throw new IllegalArgumentException(); this.isRootBlock0 = rootBlock.isRootBlock0(); this.data = BytesUtil.toArray(rootBlock.asReadOnlyBuffer()); }
public HARootBlockResponse(final IRootBlockView rootBlock) { if (rootBlock == null) throw new IllegalArgumentException(); this.isRootBlock0 = rootBlock.isRootBlock0(); this.data = BytesUtil.toArray(rootBlock.asReadOnlyBuffer()); }
public HALogRootBlocksResponse(final IRootBlockView openRootBlock, final IRootBlockView closeRootBlock) { if (openRootBlock == null) throw new IllegalArgumentException(); if (closeRootBlock == null) throw new IllegalArgumentException(); this.openIsRootBlock0 = openRootBlock.isRootBlock0(); this.closeIsRootBlock0 = closeRootBlock.isRootBlock0(); this.openData = BytesUtil.toArray(openRootBlock.asReadOnlyBuffer()); this.closeData = BytesUtil.toArray(closeRootBlock.asReadOnlyBuffer()); }
/** * Called by the HALogWriter to close the log file with the * committing rootblock. * * @param rbv * @throws IOException */ private void close(final IRootBlockView rbv) throws IOException { m_writeLock.lock(); try { if (m_closeRootBlock != null) throw new IllegalStateException("LogFile is already closed"); writeRootBlock(rbv.isRootBlock0(), rbv); m_closeRootBlock = rbv; m_callback.release(this); m_fileChange.signalAll(); } finally { m_writeLock.unlock(); } }
/** * Called by the HALogWriter to close the log file with the * committing rootblock. * * @param rbv * @throws IOException */ private void close(final IRootBlockView rbv) throws IOException { m_writeLock.lock(); try { if (m_closeRootBlock != null) throw new IllegalStateException("LogFile is already closed"); writeRootBlock(rbv.isRootBlock0(), rbv); m_closeRootBlock = rbv; m_callback.release(this); m_fileChange.signalAll(); } finally { m_writeLock.unlock(); } }
public void writeRootBlock(IRootBlockView rootBlock,ForceEnum forceOnCommit) { if (rootBlock == null) throw new IllegalArgumentException(); try { final ByteBuffer data = rootBlock.asReadOnlyBuffer(); final long pos = rootBlock.isRootBlock0() ? FileMetadata.OFFSET_ROOT_BLOCK0 : FileMetadata.OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(opener, data, pos); if( forceOnCommit != ForceEnum.No ) { force(forceOnCommit == ForceEnum.ForceMetadata); } } catch (IOException ex) { throw new RuntimeException(ex); } }
public void writeRootBlock(IRootBlockView rootBlock,ForceEnum forceOnCommit) { if (rootBlock == null) throw new IllegalArgumentException(); try { final ByteBuffer data = rootBlock.asReadOnlyBuffer(); final long pos = rootBlock.isRootBlock0() ? FileMetadata.OFFSET_ROOT_BLOCK0 : FileMetadata.OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(opener, data, pos); if( forceOnCommit != ForceEnum.No ) { force(forceOnCommit == ForceEnum.ForceMetadata); } } catch (IOException ex) { throw new RuntimeException(ex); } }
private static IRootBlockView closeRBV(final IRootBlockView rbv) { return new RootBlockView( // !rbv.isRootBlock0(), 0, 0, System.currentTimeMillis() /* commitTime */, 0, rbv .getCommitCounter() + 1 /* commitCounter */, 100, 100, // non-zero commit records rbv.getUUID(), 0, // VERSION3 rbv.getQuorumToken(), 0, // VERSION1 0, // VERSION1 rbv.getStoreType(), // storetype rbv.getCreateTime(), System.currentTimeMillis(), RootBlockView.currentVersion, ChecksumUtility.getCHK()); }
@SuppressWarnings("deprecation") private static IRootBlockView closeRBV(final IRootBlockView rbv) { return new RootBlockView( // !rbv.isRootBlock0(), 0, 0, System.currentTimeMillis() /* commitTime */, 0, rbv .getCommitCounter() + 1 /* commitCounter */, 100, 100, // non-zero commit records rbv.getUUID(), 0, // VERSION3 rbv.getQuorumToken(), 0, // VERSION1 0, // VERSION1 rbv.getStoreType(), // storetype rbv.getCreateTime(), System.currentTimeMillis(), RootBlockView.currentVersion, ChecksumUtility.getCHK()); }
private static IRootBlockView closeRBV(final IRootBlockView rbv) { return new RootBlockView( // !rbv.isRootBlock0(), 0, 0, System.currentTimeMillis() /* commitTime */, 0, rbv .getCommitCounter() + 1 /* commitCounter */, 100, 100, // non-zero commit records rbv.getUUID(), 0, // VERSION3 rbv.getQuorumToken(), 0, // VERSION1 0, // VERSION1 rbv.getStoreType(), // storetype rbv.getCreateTime(), System.currentTimeMillis(), RootBlockView.currentVersion, ChecksumUtility.getCHK()); }
@SuppressWarnings("deprecation") private static IRootBlockView closeRBV(final IRootBlockView rbv) { return new RootBlockView( // !rbv.isRootBlock0(), 0, 0, System.currentTimeMillis() /* commitTime */, 0, rbv .getCommitCounter() + 1 /* commitCounter */, 100, 100, // non-zero commit records rbv.getUUID(), 0, // VERSION3 rbv.getQuorumToken(), 0, // VERSION1 0, // VERSION1 rbv.getStoreType(), // storetype rbv.getCreateTime(), System.currentTimeMillis(), RootBlockView.currentVersion, ChecksumUtility.getCHK()); }