openSecondary

Opens the store in dir for reading beside its writer, in another process, or with no writer at all (SPEC.md §8.1). It takes no lock and never changes anything in dir: it reads what the writer had written when it opened, and catches up with what the writer writes later on SecondaryJsonStore.refresh.

Of options, the caches and StoreOptions.ioParallelism apply; what concerns writing is ignored, and files are never mapped, whatever StoreOptions.mmapReads says. The store must be on a local file system of the writer's host. While open, it holds a file handle for each log and index file of the state it reads.

Throws StoreNotFoundException when dir holds no store, and then reads nothing; CorruptionException when the store's metadata, or a part of its log the writer had synced, is damaged; and java.io.IOException when the files can't be read, or the writer changed them faster than they could be read.