com.neeve.ods
Interface IStoreWriter

All Known Subinterfaces:
IStorePersister, IStoreSender
All Known Implementing Classes:
RogLog, com.neeve.ods.impl.StorePacketPersisterBase

public interface IStoreWriter

Represents a store writer.

This interface defines a store writer. Store writers durably write store objects and/or transactions to an abstract destination.

Threading:
A writer is not safe for concurrent access by multiple threads.

Nested Class Summary
static interface IStoreWriter.LogCounters
          Holds transaction log related counters.
static class IStoreWriter.Parameters
          Contains writer parameters
 
Method Summary
 IStoreWriter.Parameters getParameters()
          Get a writer's operating parameters
 boolean isShared()
          Indicates whether the writer is writing to a shared resource.
 void onRoleChange(IStoreBinding.Role role)
          Invoked to notify of a change to the role of the using store binding.
 void sync()
          Sync any buffered operations to the write destination.
 void writeCommitEntry(StoreCommitEntry commitEntry, boolean isSerializedObjectMutable, boolean sync)
          Write a commit entry
 

Method Detail

getParameters

IStoreWriter.Parameters getParameters()
Get a writer's operating parameters


isShared

boolean isShared()
Indicates whether the writer is writing to a shared resource.

This method returns whether the writer is accessing a shared resource between primary and backup cluster members. Shared writers are only opened on the primary cluster members while non-shared writers are opened concurrently on both. However, transactions are recorded and committed concurrently on both shared and non-shared writers.


onRoleChange

void onRoleChange(IStoreBinding.Role role)
Invoked to notify of a change to the role of the using store binding.

This method is invoked by a store binding to notify a writer of a a change in the binding's role.


writeCommitEntry

void writeCommitEntry(StoreCommitEntry commitEntry,
                      boolean isSerializedObjectMutable,
                      boolean sync)
Write a commit entry

Parameters:
commitEntry - The commit entry to write
isSerializedObjectMutable - Indicates whether the serialized object in the commit entry can be mutated on return from this method.
sync - Indicates whether to sync cached disk records to disk. Setting this flag to true will perform an implicit flush.
Threading:
This method is not safe for concurrent access by multiple threads.

sync

void sync()
Sync any buffered operations to the write destination.

This operation should cause any buffered operations to be flushed to the writer destination. This method must block and wait until all recorded operations invoked prior to this method are safely at the destination.

No record operations will be invoked concurrently with this method.



Copyright © 2016 Neeve Research, LLC. All Rights Reserved.