Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- getSchema :: forall a. EncodeAvro a => a -> Schema
- encodeAvro :: EncodeAvro a => a -> ByteString
- encodeContainer :: EncodeAvro a => Codec -> Schema -> [[a]] -> IO ByteString
- newSyncBytes :: IO ByteString
- encodeContainerWithSync :: EncodeAvro a => Codec -> Schema -> ByteString -> [[a]] -> ByteString
- containerHeaderWithSync :: Codec -> Schema -> ByteString -> Builder
- packContainerBlocks :: Codec -> Schema -> [(Int, ByteString)] -> IO ByteString
- packContainerBlocksWithSync :: Codec -> Schema -> ByteString -> [(Int, ByteString)] -> ByteString
- packContainerValues :: Codec -> Schema -> [[ByteString]] -> IO ByteString
- packContainerValuesWithSync :: Codec -> 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 => Codec -> Schema -> [[a]] -> IO ByteString Source #
Encode chunks of objects into a container, using 16 random bytes for
the synchronization markers. Blocks are compressed (or not) according
to the given Codec
(nullCodec
or deflateCodec
).
newSyncBytes :: IO ByteString Source #
Generates a new synchronization marker for encoding Avro containers
encodeContainerWithSync :: EncodeAvro a => Codec -> Schema -> ByteString -> [[a]] -> ByteString Source #
Encode chunks of objects into a container, using the provided ByteString as the synchronization markers.
Packing containers
containerHeaderWithSync :: Codec -> Schema -> ByteString -> Builder Source #
Creates an Avro container header for a given schema.
packContainerBlocks :: Codec -> 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 :: Codec -> 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 :: Codec -> 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 :: Codec -> 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 #