Trait/Object

bitpeace

Bitpeace

Related Docs: object Bitpeace | package bitpeace

Permalink

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. All

Abstract Value Members

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

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    Count all FileMeta rows.

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

    Permalink

    Deletes the file data and meta-data.

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

    Permalink

    Return whether a file with a given id exists.

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

    Permalink

    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]

    Permalink

    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]]

    Permalink

    Return meta data about one file.

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

    Permalink

    Get chunks using one connection.

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

    Permalink

    “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]

    Permalink

    Insert the chunk object.

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

    Permalink

    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]

    Permalink

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

Concrete 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 addChunkByLength(chunk: FileChunk, chunksize: Int, length: Long, hint: MimetypeHint): Stream[F, Outcome[FileMeta]]

    Permalink

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

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  16. def save(data: Stream[F, Byte], chunkSize: Int, hint: MimetypeHint, time: Instant = Instant.now): Stream[F, Outcome[FileMeta]]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped