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.
- Alphabetic
- By Inheritance
- Bitpeace
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
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.
-
abstract
def
chunkExists(id: String, chunkNr: Long): Stream[F, Boolean]
Return whether a file with given id has a chunk with the given chunkNr.
-
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.
-
abstract
def
count: Stream[F, Long]
Count all FileMeta rows.
-
abstract
def
delete(id: String): Stream[F, Boolean]
Deletes the file data and meta-data.
-
abstract
def
exists(id: String): Stream[F, Boolean]
Return whether a file with a given id exists.
-
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.
-
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.
-
abstract
def
get(id: String): Stream[F, Option[FileMeta]]
Return meta data about one file.
-
abstract
def
getChunks(id: String, offset: Option[Int] = None, limit: Option[Int] = None): Stream[F, FileChunk]
Get chunks using one connection.
-
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 }}}
-
abstract
def
saveFileChunk(fc: FileChunk): Stream[F, Unit]
Insert the chunk object.
-
abstract
def
saveFileMeta(fm: FileMeta): Stream[F, Unit]
Insert the file meta object.
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()