the-algorithm/ann/src/main/scala/com/twitter/ann/hnsw/IdEmbeddingMap.scala
twitter-team ef4c5eb65e Twitter Recommendation Algorithm
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
2023-03-31 17:36:31 -05:00

14 lines
427 B
Scala

package com.twitter.ann.hnsw
import com.twitter.ann.common.EmbeddingType._
import java.io.OutputStream
trait IdEmbeddingMap[T] {
def putIfAbsent(id: T, embedding: EmbeddingVector): EmbeddingVector
def put(id: T, embedding: EmbeddingVector): EmbeddingVector
def get(id: T): EmbeddingVector
def iter(): Iterator[(T, EmbeddingVector)]
def size(): Int
def toDirectory(embeddingFileOutputStream: OutputStream): Unit
}