public class KinesisRecorder extends Object
| Constructor and Description |
|---|
KinesisRecorder(File directory,
Regions region,
AWSCredentialsProvider credentialsProvider)
Constructs a new Kinesis Recorder specifying a directory that Kinesis
Recorder has exclusive access to for storing requests.
|
KinesisRecorder(File directory,
Regions region,
AWSCredentialsProvider credentialsProvider,
KinesisRecorderConfig config)
Constructs a new Kinesis Recorder specifying a directory that Kinesis
Recorder has exclusive access to for storing requests.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAllRecords()
Removes all requests saved to disk in the directory provided this
KinesisRecorder
|
long |
getDiskByteLimit()
Returns the max number of bytes that this Kinesis Recorder will store on
disk.
|
long |
getDiskBytesUsed()
Returns the number of bytes KinesisRecorder currently has stored in the
directory passed in the constructor
|
KinesisRecorderConfig |
getKinesisRecorderConfig()
Returns the KinesisRecorderConfig this Kinesis Recorder is using.
|
void |
saveRecord(byte[] data,
String streamName)
Saves a record to local storage to be sent later.
|
void |
submitAllRecords()
Submits all requests saved to Amazon Kinesis.
|
public KinesisRecorder(File directory, Regions region, AWSCredentialsProvider credentialsProvider)
credentialsProvider - The credentials provider to use when making requests to AWSregion - The region of Amazon Kinesis this Recorder should save and
send requests to.directory - An empty directory KinesisRecorder can use for storing
requests.public KinesisRecorder(File directory, Regions region, AWSCredentialsProvider credentialsProvider, KinesisRecorderConfig config)
credentialsProvider - The credentials provider to use when making requests to AWSregion - The region of Amazon Kinesis this Recorder should save and
send requests to.directory - An empty directory KinesisRecorder can use for storing
requests.config - Allows configuring various parameters of the recorderpublic void saveRecord(byte[] data,
String streamName)
data - The data to submit to the streamstreamName - The stream to submit the data to.public void submitAllRecords()
AmazonClientException - Thrown if there was an unrecoverable error during submission. Note: If the request
appears to be invalid, the record will be deleted. If the request appears to be valid, it will be kept.public void deleteAllRecords()
public long getDiskBytesUsed()
public long getDiskByteLimit()
public KinesisRecorderConfig getKinesisRecorderConfig()
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.