trait Bitpeace[F[_]] extends AnyRef

A store for binary data.

Binary data is given as a stream of bytes. The stream is saved in chunks, where each chunk is stored into a blob object (in contrast to use one blob for the whole data). This makes it possible to effectively retrieve partial content.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Bitpeace
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def addChunk(chunk: FileChunk, chunksize: Int, totalChunks: Int, hint: MimetypeHint): Stream[F, Outcome[FileMeta]]

    Adds a new chunk of data to a file.

    Adds a new chunk of data to a file.

    Creates or updates the corresponding FileMeta record and returns it. This is useful if you get chunks of data in some random order.

    If the chunk already exists with correct length, the return value is wrapped in Outcome.Unmodified and the given chunk is not written, otherwise a Outcome#Created is returned and the chunk is stored.

  2. abstract def chunkExists(id: String, chunkNr: Long): Stream[F, Boolean]

    Return whether a file with given id has a chunk with the given chunkNr.

  3. abstract def chunkExistsRemove(id: String, chunkNr: Long, chunkLength: Long): Stream[F, Boolean]

    Like

    Like

    chunkExists}} but also checks the chunk size. If a chunk
    with different size exists, it is removed and {{{false

    is returned. with different size exists, it is removed and {{{false }}} returned.

  4. abstract def count: Stream[F, Long]

    Count all FileMeta rows.

  5. abstract def delete(id: String): Stream[F, Boolean]

    Deletes the file data and meta-data.

  6. abstract def exists(id: String): Stream[F, Boolean]

    Return whether a file with a given id exists.

  7. abstract def fetchData(range: RangeDef): Pipe[F, FileMeta, Byte]

    Fetch data using one connection per chunk.

    Fetch data using one connection per chunk. So connections are closed immediately after reading a chunk.

  8. abstract def fetchData2(range: RangeDef): Pipe[F, FileMeta, Byte]

    Fetch data using one connection for the whole stream.

    Fetch data using one connection for the whole stream. It is closed once the stream terminates.

  9. abstract def get(id: String): Stream[F, Option[FileMeta]]

    Return meta data about one file.

  10. abstract def getChunks(id: String, offset: Option[Int] = None, limit: Option[Int] = None): Stream[F, FileChunk]

    Get chunks using one connection.

  11. abstract def makeUnique(meta: FileMeta): Stream[F, Outcome[FileMeta]]

    “Merge” duplicates.

    “Merge” duplicates.

    If the given

    meta

    object contains a random id (as returned from

    saveNew

    ), check for duplicates using its checksum.

    If a duplicate is found, delete

    meta

    and its data and return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}} return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    saveNew }}}

    If a duplicate is found, delete

    meta

    and its data and return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}} return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}} from

    saveNew

    ), check for duplicates using its checksum.

    If a duplicate is found, delete

    meta

    and its data and return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}} return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    saveNew }}}

    If a duplicate is found, delete

    meta

    and its data and return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}} return the just found value. If no duplicate is found, update the id of

    meta

    to be its checksum.

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    meta }}}

    Return

    Outcome.Unmodified

    if there was a duplicate, or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

    Outcome.Unmodified }}} or

    Outcome.Created

    if there was no duplicate.

    Outcome.Created }}}

  12. abstract def saveFileChunk(fc: FileChunk): Stream[F, Unit]

    Insert the chunk object.

  13. abstract def saveFileMeta(fm: FileMeta): Stream[F, Unit]

    Insert the file meta object.

  14. abstract def saveNew(data: Stream[F, Byte], chunkSize: Int, hint: MimetypeHint, fileId: Option[String] = None, time: Instant = Instant.now): Stream[F, FileMeta]

    Save data in chunks of size chunkSize and use a random id.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addChunkByLength(chunk: FileChunk, chunksize: Int, length: Long, hint: MimetypeHint): Stream[F, Outcome[FileMeta]]

    Calculates the total number of chunks from the given length and calls addChunk.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def save(data: Stream[F, Byte], chunkSize: Int, hint: MimetypeHint, time: Instant = Instant.now): Stream[F, Outcome[FileMeta]]

    Save data in chunks of size chunkSize and check for duplicates.

    Save data in chunks of size chunkSize and check for duplicates.

    Return either

    Outcome.Created

    if new data has been written (no duplicates) or

    Outcome.Unmodified

    if no data was written and the duplicate is returned.

    Outcome.Unmodified }}} written and the duplicate is returned.

    Outcome.Created }}} (no duplicates) or

    Outcome.Unmodified

    if no data was written and the duplicate is returned.

    Outcome.Unmodified }}} written and the duplicate is returned.

  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped