@Override public void resetFromHARootBlock(final IRootBlockView rootBlock) { final long rbNextOffset = rootBlock.getNextOffset(); nextOffset.set(rbNextOffset); commitOffset.set(rbNextOffset); // Note: Potentially updated (if root blocks were reinstalled). storeUUIDRef.set(rootBlock.getUUID()); }
/** * Note: This will only succeed if the <i>uuid</i> identifies <i>this</i> * journal. */ public IRawStore openStore(final UUID uuid) { if(uuid == getRootBlockView().getUUID()) { return this; } throw new UnsupportedOperationException(); }
@Override public void resetFromHARootBlock(final IRootBlockView rootBlock) { final long rbNextOffset = rootBlock.getNextOffset(); nextOffset.set(rbNextOffset); commitOffset.set(rbNextOffset); // Note: Potentially updated (if root blocks were reinstalled). storeUUIDRef.set(rootBlock.getUUID()); }
/** * Note: This will only succeed if the <i>uuid</i> identifies <i>this</i> * journal. */ public IRawStore openStore(final UUID uuid) { if(uuid == getRootBlockView().getUUID()) { return this; } throw new UnsupportedOperationException(); }
/** * * @param fileMetadata * @param quorum The HA {@link Quorum} (optional). */ RWStrategy(final FileMetadata fileMetadata, final Quorum<?, ?> quorum) { if (fileMetadata == null) throw new IllegalArgumentException(); m_uuid = fileMetadata.rootBlock.getUUID(); // MAY be null. m_quorum = quorum; m_store = new RWStore(fileMetadata, quorum); m_am = new RWAddressManager(m_store); m_initialExtent = fileMetadata.file.length(); }
/** * * @param fileMetadata * @param quorum The HA {@link Quorum} (optional). */ RWStrategy(final FileMetadata fileMetadata, final Quorum<?, ?> quorum) { if (fileMetadata == null) throw new IllegalArgumentException(); m_uuid = fileMetadata.rootBlock.getUUID(); // MAY be null. m_quorum = quorum; m_store = new RWStore(fileMetadata, quorum); m_am = new RWAddressManager(m_store); m_initialExtent = fileMetadata.file.length(); }
@Override final public UUID getStoreUUID() { final L localService = getLocalService(); return localService.getRootBlockView().getUUID(); }
@Override final public UUID getStoreUUID() { final L localService = getLocalService(); return localService.getRootBlockView().getUUID(); }
@Override public String toString() { /* * Note: Should not depend on any state that might be unreachable, * e.g., because the store is not open, etc. */ final IRootBlockView rootBlock = getRootBlockView(); return getClass().getName() + "{file=" + getFile() + ", open=" + ManagedJournal.this.isOpen() + (rootBlock != null ? ", uuid=" + getRootBlockView().getUUID() : "") + "}"; }
@Override public String toString() { /* * Note: Should not depend on any state that might be unreachable, * e.g., because the store is not open, etc. */ final IRootBlockView rootBlock = getRootBlockView(); return getClass().getName() + "{file=" + getFile() + ", open=" + InnerCacheJournal.this.isOpen() + (rootBlock != null ? ", uuid=" + getRootBlockView().getUUID() : "") + "}"; }
@Override public String toString() { /* * Note: Should not depend on any state that might be unreachable, * e.g., because the store is not open, etc. */ final IRootBlockView rootBlock = getRootBlockView(); return getClass().getName() + "{file=" + getFile() + ", open=" + InnerCacheJournal.this.isOpen() + (rootBlock != null ? ", uuid=" + getRootBlockView().getUUID() : "") + "}"; }
@Override public String toString() { /* * Note: Should not depend on any state that might be unreachable, * e.g., because the store is not open, etc. */ final IRootBlockView rootBlock = getRootBlockView(); return getClass().getName() + "{file=" + getFile() + ", open=" + ManagedJournal.this.isOpen() + (rootBlock != null ? ", uuid=" + getRootBlockView().getUUID() : "") + "}"; }
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()); }
/** * The description of a journal. The {@link JournalMetadata} state will not * change as writes are made on the journal since it does not reflect * anything exception the {@link UUID}, the filename, and the create time. * * @param journal * The journal. */ public JournalMetadata(final AbstractJournal journal) { this(getFileString(journal), //journal.getBufferStrategy().getExtent(), journal.getRootBlockView().getUUID(), // journal.getRootBlockView().getCreateTime(), // createTime. 0L // commitTime ); }
/** * Constructor variant used to indicate a read from a specific commitTime on * a journal. * * @param journal * The journal. * @param commitTime * The commitTime. */ public JournalMetadata(final AbstractJournal journal, final long commitTime) { this(getFileString(journal), //journal.getBufferStrategy().getExtent(), journal.getRootBlockView().getUUID(),// journal.getRootBlockView().getCreateTime(),// commitTime ); }
/** * The description of a journal. The {@link JournalMetadata} state will not * change as writes are made on the journal since it does not reflect * anything exception the {@link UUID}, the filename, and the create time. * * @param journal * The journal. */ public JournalMetadata(final AbstractJournal journal) { this(getFileString(journal), //journal.getBufferStrategy().getExtent(), journal.getRootBlockView().getUUID(), // journal.getRootBlockView().getCreateTime(), // createTime. 0L // commitTime ); }
@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()); }
/** * Constructor variant used to indicate a read from a specific commitTime on * a journal. * * @param journal * The journal. * @param commitTime * The commitTime. */ public JournalMetadata(final AbstractJournal journal, final long commitTime) { this(getFileString(journal), //journal.getBufferStrategy().getExtent(), journal.getRootBlockView().getUUID(),// journal.getRootBlockView().getCreateTime(),// commitTime ); }
@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()); }