Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- getSchema :: forall a. EncodeAvro a => a -> Schema
- encodeAvro :: EncodeAvro a => a -> ByteString
- encodeContainer :: EncodeAvro a => Schema -> [[a]] -> IO ByteString
- newSyncBytes :: IO ByteString
- encodeContainerWithSync :: EncodeAvro a => Schema -> ByteString -> [[a]] -> ByteString
- containerHeaderWithSync :: Schema -> ByteString -> Builder
- packContainerBlocks :: Schema -> [(Int, ByteString)] -> IO ByteString
- packContainerBlocksWithSync :: Schema -> ByteString -> [(Int, ByteString)] -> ByteString
- packContainerValues :: Schema -> [[ByteString]] -> IO ByteString
- packContainerValuesWithSync :: Schema -> ByteString -> [[ByteString]] -> ByteString
- class EncodeAvro a where
- avro :: a -> AvroM
- class Zag a where
- putAvro :: EncodeAvro a => a -> Builder
High level interface
getSchema :: forall a. EncodeAvro a => a -> Schema Source #
encodeAvro :: EncodeAvro a => a -> ByteString Source #
encodeContainer :: EncodeAvro a => Schema -> [[a]] -> IO ByteString Source #
Encode chunks of objects into a container, using 16 random bytes for the synchronization markers.
newSyncBytes :: IO ByteString Source #
Generates a new synchronization marker for encoding Avro containers
encodeContainerWithSync :: EncodeAvro a => Schema -> ByteString -> [[a]] -> ByteString Source #
Encode chunks of objects into a container, using the provided ByteString as the synchronization markers.
Packing containers
containerHeaderWithSync :: Schema -> ByteString -> Builder Source #
Creates an Avro container header for a given schema.
packContainerBlocks :: Schema -> [(Int, ByteString)] -> IO ByteString Source #
Packs a new container from a list of already encoded Avro blocks. Each block is denoted as a pair of a number of objects within that block and the block content.
packContainerBlocksWithSync :: Schema -> ByteString -> [(Int, ByteString)] -> ByteString Source #
Packs a new container from a list of already encoded Avro blocks. Each block is denoted as a pair of a number of objects within that block and the block content.
packContainerValues :: Schema -> [[ByteString]] -> IO ByteString Source #
Packs a container from a given list of already encoded Avro values Each bytestring should represent exactly one one value serialised to Avro.
packContainerValuesWithSync :: Schema -> ByteString -> [[ByteString]] -> ByteString Source #
Packs a container from a given list of already encoded Avro values Each bytestring should represent exactly one one value serialised to Avro.
Lower level interface
class EncodeAvro a where Source #
Instances
putAvro :: EncodeAvro a => a -> Builder Source #