<commit_before>package justin.db.storage

import java.util.UUID

import justin.db.Data

import scala.concurrent.{ExecutionContext, Future}

/**
  * NOT THREAD-SAFE!
  */
class InMemStorage(implicit ec: ExecutionContext) extends PluggableStorage {
  import scala.collection.mutable

  private var values = mutable.Map.empty[UUID, Data]

  override def get(id: UUID): Future[Option[Data]] = Future.successful(values.get(id))

  override def put(data: Data): Future[Unit] = { values = values + (data.id -> data); Future.successful(()) }
}<commit_msg>define logic of InMemStorage Get operation<commit_after>package justin.db.storage

import java.util.UUID

import justin.db.Data

import scala.concurrent.{ExecutionContext, Future}

/**
  * NOT THREAD-SAFE!
  */
class InMemStorage(implicit ec: ExecutionContext) extends PluggableStorage {
  import scala.collection.mutable

  private case class MapVal(data1: Data, data2: Option[Data])

  private var values = mutable.Map.empty[UUID, MapVal]

  override def get(id: UUID): Future[StorageGetData] = Future.successful {
    values.get(id) match {
      case None                             => StorageGetData.None
      case Some(MapVal(data1, Some(data2))) => StorageGetData.Conflicted(data1, data2)
      case Some(MapVal(data1, None))        => StorageGetData.Single(data1)
    }
  }

  override def put(data: Data): Future[Unit] = Future.successful {
    ???
  }
}
{'fraction_non_alphanumeric': 0.11898016997167139, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 3.9929328621908127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1221804', 'n_tokens_mistral': 446, 'n_tokens_neox': 447, 'n_words': 102}