BlockingJsonStore

The operations of JsonStore without coroutines, obtained from JsonStore.blocking. Thread-safe.

It is a view of a JsonStore and deliberately not AutoCloseable: the JsonStore owns the directory lock and the files, so it is the JsonStore that is closed, typically with JsonStore.open(dir).use { … }.

Properties

Functions

Link copied to clipboard
abstract fun assignType(node: NodeRef, type: String?)
Link copied to clipboard
abstract fun assignTypes(assignments: List<Pair<NodeRef, String?>>)
Link copied to clipboard
abstract fun clearType(type: String): Long
Link copied to clipboard
abstract fun count(query: DocumentKeyQuery, atMost: Long = Long.MAX_VALUE): Long
abstract fun count(query: JsonPathQuery, atMost: Long = Long.MAX_VALUE): Long
abstract fun count(query: KeyValueQuery, atMost: Long = Long.MAX_VALUE): Long
Link copied to clipboard
Link copied to clipboard
abstract fun delete(docId: DocId): Boolean
Link copied to clipboard
abstract fun deleteAll(docIds: Collection<DocId>): Int
Link copied to clipboard
abstract fun diff(a: CompareOperand, b: CompareOperand, options: DiffOptions = DiffOptions()): List<Difference>

The differences of ReadableJsonStore.diff, at most DiffOptions.maxDifferences of them.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun insert(source: InputStream, types: Map<String, String> = emptyMap()): DocId
abstract fun insert(path: Path, types: Map<String, String> = emptyMap()): DocId
abstract fun insert(json: String, types: Map<String, String> = emptyMap()): DocId

Inserts a document given as a string; meant for small documents.

Link copied to clipboard
Link copied to clipboard
abstract fun isEqual(a: CompareOperand, b: CompareOperand, options: CompareOptions = CompareOptions()): Boolean
Link copied to clipboard
Link copied to clipboard
abstract fun objectsOfType(type: String, after: NodeRef? = null, limit: Int = 100): List<NodeRef>
Link copied to clipboard
abstract fun objectsOfTypePage(type: String, after: Cursor? = null, limit: Int = 100): TypePage
Link copied to clipboard
Link copied to clipboard
abstract fun replace(docIds: Collection<DocId>, source: InputStream, types: Map<String, String> = emptyMap()): DocId
abstract fun replace(docIds: Collection<DocId>, path: Path, types: Map<String, String> = emptyMap()): DocId
abstract fun replace(docIds: Collection<DocId>, json: String, types: Map<String, String> = emptyMap()): DocId
Link copied to clipboard
abstract fun search(query: JsonPathQuery): SearchResult
abstract fun search(query: KeyValueQuery): SearchResult

Starts a search on the current state; close the result when done.

Link copied to clipboard
Link copied to clipboard
abstract fun typeOf(node: NodeRef): String?
Link copied to clipboard
abstract fun upsert(source: InputStream, types: Map<String, String> = emptyMap()): DocId
abstract fun upsert(path: Path, types: Map<String, String> = emptyMap()): DocId
abstract fun upsert(json: String, types: Map<String, String> = emptyMap()): DocId
Link copied to clipboard
abstract fun verify(progress: VerifyProgress = VerifyProgress { _, _, _ -> }): VerifyReport

See ReadableJsonStore.verify; throwing from progress stops the scrub with that exception.