Example usage for com.amazonaws.services.kinesis.model StreamDescription getStreamName

List of usage examples for com.amazonaws.services.kinesis.model StreamDescription getStreamName

Introduction

In this page you can find the example usage for com.amazonaws.services.kinesis.model StreamDescription getStreamName.

Prototype


public String getStreamName() 

Source Link

Document

The name of the stream being described.

Usage

From source file:com.haskins.cloudtrailviewer.dialog.resourcedetail.detailpanels.KinesisStreamDetail.java

License:Open Source License

private void buildUI(DescribeStreamResult detail) {

    this.add(primaryScrollPane, BorderLayout.CENTER);

    if (detail.getStreamDescription() != null) {

        StreamDescription stream = detail.getStreamDescription();

        if (stream.getHasMoreShards() != null) {
            primaryTableModel.addRow(new Object[] { "Has More Shards", stream.getHasMoreShards() });
        }//w ww  .  j ava2s.c o  m
        if (stream.getStreamARN() != null) {
            primaryTableModel.addRow(new Object[] { "Stream Arn", stream.getStreamARN() });
        }
        if (stream.getStreamName() != null) {
            primaryTableModel.addRow(new Object[] { "Stream Name", stream.getStreamName() });
        }
        if (stream.getStreamStatus() != null) {
            primaryTableModel.addRow(new Object[] { "Stram Status", stream.getStreamStatus() });
        }
    }

}

From source file:dbtucker.connect.kinesis.KinesisSourceConnector.java

License:Apache License

@Override
public List<Map<String, String>> taskConfigs(int maxTasks) {
    Shard shard;//  w  w w .j a  v a 2 s  .  c om
    StreamDescription streamDesc;
    List<String> shardUuids = new ArrayList<String>();

    for (Map.Entry<Shard, DescribeStreamResult> entry : streamShards.entrySet()) {
        shard = entry.getKey();
        streamDesc = entry.getValue().getStreamDescription();
        shardUuids.add(streamDesc.getStreamName() + "/" + shard.getShardId().toString());
    }

    int numGroups = Math.min(shardUuids.size(), maxTasks);
    List<List<String>> shardsGrouped = ConnectorUtils.groupPartitions(shardUuids, numGroups);
    List<Map<String, String>> taskConfigs = new ArrayList<>(shardsGrouped.size());

    for (List<String> taskShards : shardsGrouped) {
        Map<String, String> taskProps = new HashMap<>();
        taskProps.put(KinesisSourceTaskConfig.CfgKeys.REGION, config.getRegion());
        taskProps.put(KinesisSourceTaskConfig.CfgKeys.REC_PER_REQ, "10");
        taskProps.put(KinesisSourceTaskConfig.CfgKeys.TOPIC_FORMAT, config.getTopicFormat());
        taskProps.put(KinesisSourceTaskConfig.CfgKeys.SHARDS, String.join(",", taskShards));
        taskConfigs.add(taskProps);
    }
    return taskConfigs;
}

From source file:org.lendingclub.mercator.aws.KinesisScanner.java

License:Apache License

private void project(StreamDescription description) {

    ObjectNode n = mapper.createObjectNode();
    n.put("aws_account", getAccountId());
    n.put("aws_region", getRegion().getName());
    n.put("aws_arn", description.getStreamARN());
    n.put("name", description.getStreamName());
    n.put("aws_name", description.getStreamName());
    n.put("aws_status", description.getStreamStatus());
    n.put("aws_streamCreationTimestamp", description.getStreamCreationTimestamp().getTime());
    n.put("aws_retentionPeriodHours", description.getRetentionPeriodHours());
    n.put("aws_shardCount", description.getShards().size());

    incrementEntityCount();/*from w  ww  .  j av  a  2s.co  m*/
    String cypher = "merge (k:AwsKinesisStream {aws_arn:{aws_arn}}) set k+={props}, k.updateTs=timestamp() return k";

    getNeoRxClient().execCypher(cypher, "aws_arn", n.path("aws_arn").asText(), "props", n);

    cypher = "match (a:AwsAccount {aws_account:{account}}), (k:AwsKinesisStream {aws_account:{account}}) MERGE (a)-[r:OWNS]->(k) set r.updateTs=timestamp()";

    getNeoRxClient().execCypher(cypher, "account", getAccountId());

}