package com.correx.infrastructure.artifactscas.index

import com.correx.infrastructure.artifactscas.segment.Location

interface ArtifactIndex : AutoCloseable {
    suspend fun lookup(hash: ByteArray): Location?
    suspend fun insert(hash: ByteArray, loc: Location)
    suspend fun update(hash: ByteArray, loc: Location)
    suspend fun entriesIn(segmentId: Long): List<Pair<ByteArray, Location>>
    suspend fun deleteEntriesIn(segmentId: Long)
    suspend fun flush()
    suspend fun maxKnownTailFor(segmentId: Long): Long
}
