mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-02 01:08:47 +02:00
ef4c5eb65e
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.
14 lines
427 B
Scala
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
|
|
}
|