Class

io.iohk.iodb

LSMStore

Related Docs: object LSMStore | package iodb

Permalink

class LSMStore extends Store

Created by jan on 18.1.17.

Linear Supertypes
Store, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LSMStore
  2. Store
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LSMStore(dir: File, keySize: Int = 32, executor: Executor = Executors.newCachedThreadPool(), maxJournalEntryCount: Int = 1000000, maxShardUnmergedCount: Int = 4, splitSize: Int = 1024 * 1024, keepVersions: Int = 0, maxFileSize: Long = 64 * 1024 * 1024)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(key: K): V

    Permalink

    returns value associated with the key or throws NoSuchElementException

    returns value associated with the key or throws NoSuchElementException

    Definition Classes
    Store
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clean(count: Int): Unit

    Permalink

    Starts or resumes background compaction.

    Starts or resumes background compaction. Compaction performs cleanup and runs in background process. It removes older version and compacts index to consume less space.

    count

    how many past versions to keep

    Definition Classes
    LSMStoreStore
  7. def cleanStop(): Unit

    Permalink

    Pauses background compaction process.

    Pauses background compaction process. This can be used if machine needs all available CPU power for other tasks.

    Definition Classes
    LSMStoreStore
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(): Unit

    Permalink

    Closes store.

    Closes store. All resources associated with this store are closed and released (files, background threads...). Any get/update operations invoked on closed store will throw an exception.

    Definition Classes
    LSMStoreStore
  10. def createEmptyShard(): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  11. def deserializeShardSpec(in: DataInputStream): ShardSpec

    Permalink
    Attributes
    protected[io.iohk.iodb]
  12. val dir: File

    Permalink
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. val executor: Executor

    Permalink
  16. val fileAccess: FileAccess

    Permalink
  17. val fileHandles: HashMap[Long, Any]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  18. val fileOuts: HashMap[Long, FileOutputStream]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def get(key: K): Option[V]

    Permalink

    Finds key and returns value associated with the key.

    Finds key and returns value associated with the key. If key is not found, it returns null.

    It uses lattest (most recent) version available in store.

    key

    to lookup

    returns

    value associated with key or null

    Definition Classes
    LSMStoreStore
  21. def get(keys: Iterable[K], consumer: (K, Option[V]) ⇒ Unit): Unit

    Permalink

    Batch get with callback for result value.

    Batch get with callback for result value.

    Finds all keys from given iterable. Results are passed to callable consumer.

    It uses lattest (most recent) version available in store

    keys

    keys to lookup

    consumer

    callback method to consume results

    Definition Classes
    Store
  22. def get(keys: Iterable[K]): Iterable[(K, Option[V])]

    Permalink

    Batch get.

    Batch get.

    Finds all keys from given iterable. Result is returned in an iterable of key-value pairs. If key is not found, null value is included in result pair.

    It uses lattest (most recent) version available in store

    keys

    keys to loopup

    returns

    iterable over key-value pairs found in store

    Definition Classes
    Store
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def getOrElse(key: K, default: ⇒ V): V

    Permalink

    Returns value associated with the key, or defualt value from user

    Returns value associated with the key, or defualt value from user

    Definition Classes
    Store
  25. def getUpdates(key: K, logFile: List[LogFileUpdate]): Option[V]

    Permalink
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. def initJournal(): Unit

    Permalink

    creates new journal file, if no file is opened

    creates new journal file, if no file is opened

    Attributes
    protected
  28. def initShardLayoutLog(): Unit

    Permalink
    Attributes
    protected[io.iohk.iodb]
  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. def isJournalFile(f: File): Boolean

    Permalink
    Attributes
    protected[io.iohk.iodb]
  31. def isShardFile(f: File): Boolean

    Permalink
    Attributes
    protected[io.iohk.iodb]
  32. val journalCache: TreeMap[K, V]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  33. def journalCurrentFileNum(): Long

    Permalink
    Attributes
    protected
  34. def journalDeleteFilesButNewest(): Unit

    Permalink
    Attributes
    protected[io.iohk.iodb]
  35. var journalDirty: List[LogFileUpdate]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  36. def journalFileToNum(f: File): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  37. var journalLastVersionID: Option[VersionID]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  38. def journalListSortedFiles(): Seq[File]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  39. def journalNewFileNum(): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  40. var journalRollback: List[LogFileUpdate]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  41. def journalStartNewFile(): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  42. val keepVersions: Int

    Permalink
  43. val keySize: Int

    Permalink
  44. def keyValues(fileLog: List[LogFileUpdate]): Iterator[(K, V)]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  45. def lastVersionID: Option[VersionID]

    Permalink

    Returns current versionID used by Store.

    Returns current versionID used by Store. It is last version store was update to with update() method.

    If store is empty, the last version does not exist yet and store returns None

    VersionID is persisted between restarts.

    Definition Classes
    LSMStoreStore
  46. def linkTogether(versionID: VersionID, updates: Iterable[LogFileUpdate]): List[LogFileUpdate]

    Permalink

    expand shard tails into linked lists

    expand shard tails into linked lists

    Attributes
    protected[io.iohk.iodb]
  47. def listFiles(): Array[File]

    Permalink
    Attributes
    protected
  48. def loadJournal(files: Iterable[Long]): Buffer[LogFileUpdate]

    Permalink

    read files and reconstructs linked list of updates

    read files and reconstructs linked list of updates

    Attributes
    protected[io.iohk.iodb]
  49. def loadUpdates(file: File, fileNum: Long): Iterable[LogFileUpdate]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  50. val lock: ReentrantReadWriteLock

    Permalink
  51. val maxFileSize: Long

    Permalink
  52. val maxJournalEntryCount: Int

    Permalink
  53. val maxShardUnmergedCount: Int

    Permalink
  54. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  55. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  56. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  57. def numToFile(n: Long): File

    Permalink
    Attributes
    protected[io.iohk.iodb]
  58. def rollback(versionID: VersionID): Unit

    Permalink

    Reverts to an older versionID.

    Reverts to an older versionID. All key-value pairs are reverted to this older version (updates between two versionIDs are removed).

    Higher (newer) versionIDs are discarded and their versionID can be reused

    Definition Classes
    LSMStoreStore
  59. def serializeShardSpec(versionID: VersionID, shards: Seq[(K, Long, VersionID)]): Array[Byte]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  60. def serializeUpdate(versionID: VersionID, prevVersionID: VersionID, toRemove: Iterable[K], toUpdate: Iterable[(K, V)], isMerged: Boolean): Array[Byte]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  61. def shardFileToNum(f: File): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  62. var shardLayoutLog: FileOutputStream

    Permalink
    Attributes
    protected[io.iohk.iodb]
  63. def shardListSortedFiles(): Seq[File]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  64. def shardNewFileNum(): Long

    Permalink
    Attributes
    protected[io.iohk.iodb]
  65. val shardRollback: LinkedHashMap[VersionID, ShardLayout]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  66. var shards: TreeMap[K, List[LogFileUpdate]]

    Permalink
    Attributes
    protected[io.iohk.iodb]
  67. val splitSize: Int

    Permalink
  68. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  69. def takeWhileExtra[A](iter: Iterable[A], f: (A) ⇒ Boolean): Iterable[A]

    Permalink
  70. def taskCleanup(deleteFiles: Boolean = true): Unit

    Permalink

    closes and deletes files which are no longer needed

  71. def taskRun(f: ⇒ Unit): Unit

    Permalink
  72. def taskShardMerge(shardKey: K): Unit

    Permalink
  73. def taskSharding(): Unit

    Permalink

    Task ran periodically in background thread.

    Task ran periodically in background thread. It distributes content of Journal between Shards.

  74. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  75. def update(versionID: VersionID, toRemove: Iterable[K], toUpdate: Iterable[(K, V)]): Unit

    Permalink

    Batch update records.

    Batch update records.

    Each update increments versionID. New versionID is passed as an argument.

    Update might remove some key-value pairs, or can insert new key-value pairs. Iterable of keys to be deleted, and iterable of key-value pairs to be updated is passed as an argument.

    versionID

    new versionID associated with this update

    toRemove

    iterable over keys which will be deleted in this update

    toUpdate

    iterable over key-value pairs which will be inserted in this update

    Definition Classes
    LSMStoreStore
  76. def update(version: Long, toRemove: Iterable[K], toUpdate: Iterable[(K, V)]): Unit

    Permalink
    Definition Classes
    Store
  77. def updateAppend(fileNum: Long, toRemove: Iterable[K], toUpdate: Iterable[(K, V)], versionID: VersionID, prevVersionID: V, merged: Boolean): LogFileUpdate

    Permalink
    Attributes
    protected[io.iohk.iodb]
  78. def verify(): Unit

    Permalink
  79. def versionIDExists(versionID: VersionID): Boolean

    Permalink
  80. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  82. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Store

Inherited from AnyRef

Inherited from Any

Ungrouped