@Override public ByteBuffer readRootBlock(boolean rootBlock0) { return (rootBlock0 ? m_rb0 : m_rb1).asReadOnlyBuffer(); }
public ByteBuffer readRootBlock(boolean rootBlock0) { return rootBlocks[rootBlock0 ? 0 : 1].asReadOnlyBuffer(); }
@Override public ByteBuffer readRootBlock(boolean rootBlock0) { return (rootBlock0 ? m_rb0 : m_rb1).asReadOnlyBuffer(); }
public ByteBuffer readRootBlock(boolean rootBlock0) { return rootBlocks[rootBlock0 ? 0 : 1].asReadOnlyBuffer(); }
/** * {@inheritDoc} * * Overriden to implement equality based on the data in the * {@link IRootBlockView}. */ @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof IRootBlockView)) return false; final IRootBlockView o2 = (IRootBlockView) o; if (!buf.asReadOnlyBuffer().equals(o2.asReadOnlyBuffer())) return false; return true; }
/** * {@inheritDoc} * * Overriden to implement equality based on the data in the * {@link IRootBlockView}. */ @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof IRootBlockView)) return false; final IRootBlockView o2 = (IRootBlockView) o; if (!buf.asReadOnlyBuffer().equals(o2.asReadOnlyBuffer())) return false; return true; }
public HASendStoreResponse(final IRootBlockView rootBlock0, final IRootBlockView rootBlock1, final long byteCount, final long blockCount) { if (rootBlock0 == null) throw new IllegalArgumentException(); if (rootBlock1 == null) throw new IllegalArgumentException(); this.rootBlock0 = BytesUtil.toArray(rootBlock0.asReadOnlyBuffer()); this.rootBlock1 = BytesUtil.toArray(rootBlock1.asReadOnlyBuffer()); this.byteCount = byteCount; this.blockCount = blockCount; }
public HASendStoreResponse(final IRootBlockView rootBlock0, final IRootBlockView rootBlock1, final long byteCount, final long blockCount) { if (rootBlock0 == null) throw new IllegalArgumentException(); if (rootBlock1 == null) throw new IllegalArgumentException(); this.rootBlock0 = BytesUtil.toArray(rootBlock0.asReadOnlyBuffer()); this.rootBlock1 = BytesUtil.toArray(rootBlock1.asReadOnlyBuffer()); this.byteCount = byteCount; this.blockCount = blockCount; }
private void writeRootBlock(final boolean isRootBlock0, final IRootBlockView rootBlock) throws IOException { if (rootBlock == null) throw new IllegalArgumentException(); final long position = isRootBlock0 ? OFFSET_ROOT_BLOCK0 : OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(m_reopener, rootBlock.asReadOnlyBuffer(), position); if (log.isDebugEnabled()) log.debug("wrote root block: " + rootBlock); }
private void writeRootBlock(final boolean isRootBlock0, final IRootBlockView rootBlock) throws IOException { if (rootBlock == null) throw new IllegalArgumentException(); final long position = isRootBlock0 ? OFFSET_ROOT_BLOCK0 : OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(m_reopener, rootBlock.asReadOnlyBuffer(), position); if (log.isDebugEnabled()) log.debug("wrote root block: " + rootBlock); }
/** * Writes the root block at the given offset. */ private void writeRootBlock(final boolean isRootBlock0, final IRootBlockView rootBlock) throws IOException { if (rootBlock == null) throw new IllegalArgumentException(); final long position = isRootBlock0 ? OFFSET_ROOT_BLOCK0 : OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(reopener, rootBlock.asReadOnlyBuffer(), position); if (haLog.isDebugEnabled()) haLog.debug("wrote root block: " + rootBlock); }
/** * Writes the root block at the given offset. */ private void writeRootBlock(final boolean isRootBlock0, final IRootBlockView rootBlock) throws IOException { if (rootBlock == null) throw new IllegalArgumentException(); final long position = isRootBlock0 ? OFFSET_ROOT_BLOCK0 : OFFSET_ROOT_BLOCK1; FileChannelUtility.writeAll(reopener, rootBlock.asReadOnlyBuffer(), position); if (haLog.isDebugEnabled()) haLog.debug("wrote root block: " + rootBlock); }
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 HASnapshotResponse(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 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 HARootBlockResponse(final IRootBlockView rootBlock) { if (rootBlock == null) throw new IllegalArgumentException(); this.isRootBlock0 = rootBlock.isRootBlock0(); this.data = BytesUtil.toArray(rootBlock.asReadOnlyBuffer()); }
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); } }