Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Ensure that a single Cassandra connector is shared - #107

Merged
c-w merged 1 commit into
masterfrom
cassandra-implicit-connector
Aug 25, 2017
Merged

Ensure that a single Cassandra connector is shared#107
c-w merged 1 commit into
masterfrom
cassandra-implicit-connector

Conversation

@c-w

@c-w c-w commented Aug 25, 2017

Copy link
Copy Markdown
Contributor

As per conversation in Slack. Still needs to be perf-tested to see if there's an improvement. (In any case it shouldn't hurt.)

@c-w
c-w requested a review from kevinhartman August 25, 2017 00:15
@c-w
c-w force-pushed the cassandra-implicit-connector branch from 145bd42 to e902a90 Compare August 25, 2017 00:15

// Main starts here
val ssc = StreamingContext.getOrCreate(fortisSettings.progressDir, createStreamingContext)
implicit val connector: CassandraConnector = CassandraConnector(ssc.sparkContext)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing will bind to this here. How about putting this inside CassandraEventsSink.apply and making it lazy as well (to ensure it doesn't get re-serialized for every task)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b889974.

@c-w
c-w force-pushed the cassandra-implicit-connector branch from e902a90 to b889974 Compare August 25, 2017 00:32
@c-w
c-w merged commit 720c080 into master Aug 25, 2017
@c-w
c-w deleted the cassandra-implicit-connector branch August 25, 2017 00:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants