Copyright | Copyright (c) 2013-2015 PivotCloud, Inc. |
---|---|
License | Apache License, Version 2.0 |
Maintainer | Lars Kuhtz <lars@alephcloud.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
API Version: 2013-12-02
The Amazon Kinesis Service API Reference API contains several data types that various actions use.
http://docs.aws.amazon.com/kinesis/2013-12-02/APIReference/API_Types.html
- data StreamName
- streamName :: Text -> Either Text StreamName
- streamNameText :: StreamName -> Text
- data ShardId
- data SequenceNumber
- data PartitionHash
- partitionHash :: Integer -> Either Text PartitionHash
- partitionHashInteger :: PartitionHash -> Integer
- data PartitionKey
- partitionKey :: Text -> Either Text PartitionKey
- partitionKeyText :: PartitionKey -> Text
- data ShardIterator
- data ShardIteratorType
- data Record = Record {}
- data StreamDescription = StreamDescription {}
- data StreamStatus
- data Shard = Shard {}
Documentation
data StreamName Source
Stream Name
The stream name is scoped to the AWS account used by the application that creates the stream. It is also scoped by region. That is, two streams in two different AWS accounts can have the same name, and two streams in the same AWS account, but in two different regions, can have the same name.
Length constraints: Minimum length of 1. Maximum length of 128.
Error responses from AWS Kinesis indicate that stream names must match the following regular expressions:
[a-zA-Z0-9_.-]+
Eq StreamName | |
Ord StreamName | |
Read StreamName | |
Show StreamName | |
IsString StreamName | The |
Arbitrary StreamName | |
ToJSON StreamName | |
FromJSON StreamName | |
Typeable * StreamName | |
ListResponse ListStreamsResponse StreamName |
streamName :: Text -> Either Text StreamName Source
Smart Constructor for StreamName
that enforces size constraints.
For static construction you may also use the IsString
instance
that throws an error
on invalid stream names.
streamNameText :: StreamName -> Text Source
Identifier for a shard as returned by PutRecord.
Length constraints: Minimum length of 1. Maximum length of 128.
data SequenceNumber Source
Opaque sequence number as returned by PutRecord.
data PartitionHash Source
An 128 bit interger that identifies the partition. The default is the MD5 hash of the partition key.
FIXME the specification is rather vague about the precise encoding of this value. The default is to compute it as an MD5 hash of the partition key. The API reference describes it as an Int128. However, it is not clear how the result of the hash function is encoded (big-endian or small endian, word size?) and how it is serialized to text, which is the type in the JSON serialization.
http://javadox.com/com.amazonaws/aws-java-sdk/1.7.1/com/amazonaws/services/kinesis/model/PutRecordRequest.html seems to indicate that the value is actually unsigned.
partitionHash :: Integer -> Either Text PartitionHash Source
Smart Constructor for PartitionHash
that enforces size constraints.
data PartitionKey Source
PartitionKey
Identifies which shard in the stream the data record is assigned to.
Partition keys are Unicode strings with a maximum length limit of 256 bytes. Amazon Kinesis uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key will map to the same shard within the stream.
Length constraints: Minimum length of 1. Maximum length of 256.
partitionKey :: Text -> Either Text PartitionKey Source
data ShardIterator Source
Iterator for records within a shard.
Length constraints: Minimum length of 1. Maximum length of 512.
data ShardIteratorType Source
ShardIteratorType
Determines how the shard iterator is used to start reading data records from the shard.
AtSequenceNumber | Start reading exactly from the position denoted by a specific sequence number. |
AfterSequenceNumber | Start reading right after the position denoted by a specific sequence number. |
TrimHorizon | Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard. |
Latest | Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard. |
Record
The unit of data of the Amazon Kinesis stream, which is composed of a sequence number, a partition key, and a data blob.
http://docs.aws.amazon.com/kinesis/2013-12-02/APIReference/API_Record.html
Record | |
|
data StreamDescription Source
StreamDescription | |
|
data StreamStatus Source
StreamStatusCreating | The stream is being created. Upon receiving a CreateStream request, Amazon Kinesis immediately returns and sets StreamStatus to CREATING. |
StreamStatusDeleting | The stream is being deleted. After a DeleteStream request, the specified stream is in the DELETING state until Amazon Kinesis completes the deletion. |
StreamStatusActive | The stream exists and is ready for read and write operations or deletion. You should perform read and write operations only on an ACTIVE stream. |
StreamStatusUpdating | Shards in the stream are being merged or split. Read and write operations continue to work while the stream is in the UPDATING state. |
Shard | |
|