storm-postgresql

An implementation of Apache Storm Trident state that uses PostgreSQL

License

License

Categories

Categories

PostgreSQL Data Databases ORM
GroupId

GroupId

com.snacktrace
ArtifactId

ArtifactId

storm-postgresql
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

storm-postgresql
An implementation of Apache Storm Trident state that uses PostgreSQL
Project URL

Project URL

https://github.com/s-nel/storm-postgresql
Source Code Management

Source Code Management

https://github.com/s-nel/storm-postgresql

Download storm-postgresql

How to add to project

<!-- https://jarcasting.com/artifacts/com.snacktrace/storm-postgresql/ -->
<dependency>
    <groupId>com.snacktrace</groupId>
    <artifactId>storm-postgresql</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.snacktrace/storm-postgresql/
implementation 'com.snacktrace:storm-postgresql:1.0.0'
// https://jarcasting.com/artifacts/com.snacktrace/storm-postgresql/
implementation ("com.snacktrace:storm-postgresql:1.0.0")
'com.snacktrace:storm-postgresql:jar:1.0.0'
<dependency org="com.snacktrace" name="storm-postgresql" rev="1.0.0">
  <artifact name="storm-postgresql" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.snacktrace', module='storm-postgresql', version='1.0.0')
)
libraryDependencies += "com.snacktrace" % "storm-postgresql" % "1.0.0"
[com.snacktrace/storm-postgresql "1.0.0"]

Dependencies

provided (2)

Group / Artifact Type Version
org.apache.storm : storm-core jar 1.0.0
org.postgresql : postgresql jar 9.3-1102-jdbc4

Project Modules

There are no modules declared in this project.

storm-postgresql

Snacktrace Score

A Trident state implementation for PostgreSQL that supports non-transactional, transactional, and opaque-transactional modes

Maven Coordinates

<dependency>
  <groupId>com.snacktrace</groupId>
  <artifactId>storm-postgresql</artifactId>
  <version>1.0.0</version>
</dependency>

SBT

libraryDependencies += "com.snacktrace" % "storm-postgresql" % "1.0.0"

Usage

PostgresqlStatConfig postgresConfig = new PostgresqlStateConfig();
postgresConfig.setUrl("jdbc:postgresql://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD");
postgresConfig.setTable("TABLE");
postgresConfig.setType(StateType.OPAQUE);
// Key columns are the columns that form a compound, unique key for the state
postgresConfig.setKeyColumns(new String[]{"word"});
// Value columns are the columns that will hold the value of the state
postgresConfig.setValueColumns(new String[]{"count"});
// The sql type of the key columns
postgresConfig.setKeyTypes(new String[]{"text"});
// The sql type of the value columns
postgresConfig.setValueTypes(new String[]{"integer"});
// Construct a state factory using the configuration
Factory factory = PostgresqlState.newFactory(postgresConfig);

// Then use the factory to persist state in your topology. E.g.
topology.newStream("spout1", spout)
  .each(new Fields("str"), new Split(), new Fields("word"))
  .groupBy(new Fields("word"))
  .persistentAggregate(factory, new Count(), new Fields("count"))

Versions

Version
1.0.0