-
Notifications
You must be signed in to change notification settings - Fork 91
fix #106 Gearpump Redis Integration #11
base: master
Are you sure you want to change the base?
Conversation
@darionyaphet we probably need some unit tests. Good job on splitting example and actual definitions into example and external. It doesn't look like the build failures are related
|
@darionyaphet thanks for your contributions. please add license headers |
@manuzhang I have add license headers . @kkasravi I will add some unit tests . thank you :) |
@darionyaphet we have changed Gearpump's package name, please rebase our latest code. Sorry for the inconvenient. |
@darionyaphet also please modify your commit comment to |
Hi @manuzhang what is the commit format ? I found some rules on
|
Hi @huafengw sure I will rename packages from io.gearpump to org.apache.gearpump :D |
@darionyaphet yes, as we use jira now issue id should be GEARPUMP-XXX. You may our recent commits for examples |
} | ||
} | ||
|
||
object RedisSourceSink extends AkkaApp with ArgumentsParser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RedisSourceSink doesn't sound like an example and I can't get what the example does from the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RedisSourceSink
which is mean reading from RedisSource and write messages to RedisSink :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe name RedisSourceSinkExample
@darionyaphet Could you add this module to the experiments ? That will be low risk before the module is mature. Plus, the experiments doesn't require UT coverage. Also, please add a README for how to use this module. |
import taskContext.output | ||
|
||
override def onNext(message: Message): Unit = { | ||
val msg = message.msg.asInstanceOf[Option[String]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be better as
Option(message.msg) match {
case Some(msg) =>
val upper = msg.asInstanceOf[String].toUpperCase
LOG.info(s"to Upper $upper")
outer(new Message(upper, message.timestamp))
case None =>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good ! I will update this :)
Though the new package name is right, you still need to rebase latest master branch to correct the import. |
@darionyaphet if you are time constrained please let us know and we can make the changes noted above. We would like to get this into the next release if possible (we're targeting in about 2 weeks). |
Sorry to reply it with so long .@manuzhang @huafengw redis examples class name have rename to
@kkasravi I will fix and add some comment at weekend :) |
d9304ef
to
64811ca
Compare
CrossVersion.binaryScalaVersion(scalaVersion.value) | ||
) ++ | ||
Seq( | ||
mainClass in (Compile, packageBin) := Some("org.apache.gearpump.streaming.example.redis.RedisSourceStorageExample"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not correct, one manifest can only have one main class.
Seq(
mainClass in (Compile, packageBin) := Some("org.apache.gearpump.streaming.example.redis.RedisSourceSinkExample"),
target in assembly := baseDirectory.value.getParentFile.getParentFile / "target" /
CrossVersion.binaryScalaVersion(scalaVersion.value)
)
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @huafengw when I package using SBT , the main class will specifies into META-INF ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's what sbt-pack did.
def this(key: String, value: String) = this(toBytes(key), toBytes(value)) | ||
} | ||
|
||
case class LPushMessage(key: Array[Byte], value: Array[Byte]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear how this message type can be used. LPushMessage
looks the same as RPushMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LPushMessage
and RPushMessage
are difference message to control redis client add element at list's head or tail
@darionyaphet What's the difference between |
I think I see the idea behind RedisSink and RedisStorage. Redis is advertised as "data structure store". It supports structures (like strings, lists, sets, hashes, etc.) and operation on them (add element to a set, remove element; add element at the beginning of a list, at the end; remove element from head/tail of the list, etc.). RedisSource and RedisSink work on "classic" message stream utilizing Redis' pub/sub mechanizm. The source subscribes to a channel. The sink publishes to a channel. RedisStorage reads a message and let you make a Redis command (add to list, set, etc.). The subset of commands is defined in RedisMessage. (I would think about changing the name, though. For example RedisCommandSink or similar). @manuzhang what do you think? |
Current coverage is 64.10%
|
@manuzhang actually storm-redis act as a ORM framework and put the message into a redis instance . So it don't have a full command support . I think we can support more command such as delete , ttl and exists . |
We are developing under 'experiments' here. I'd be happy to have something decent here. Maybe not full-blown, but functional. My point is: Let us release first version of the redis connector and improve it in next releases. |
@karol-brejna-i @darionyaphet I understand the difference between |
@karol-brejna-i It's seems have a lot things to do .
|
|
My message is: let's release first version of Redis Connector soon and give ourselves time to improve ;-) |
@kkasravi @manuzhang After we have a discuss , I will repush it :) |
@darionyaphet this is partially done in #93. Please rebase or, close and fire a new PR for follow-ups. |
update the rest api
Author: Kam Kasravi <[email protected]> Closes apache#11 from kkasravi/asf-site.
Author: Kam Kasravi <[email protected]> Closes apache#11 from kkasravi/asf-site.
Redis is a hight performance in memory storage , and have widely used in a lot of project .
It's should support redis as DataSource and DataSink .