sborya commented on a change in pull request #1166: SAMZA-2328: [Scala cleanup]
Convert StreamConfig to Java (part 1: update test coverage and clarify
functionality in javadocs)
URL: https://github.com/apache/samza/pull/1166#discussion_r328260879
##########
File path: samza-core/src/main/scala/org/apache/samza/config/StreamConfig.scala
##########
@@ -199,16 +199,29 @@ class StreamConfig(config: Config) extends
ScalaMapConfig(config) with Logging {
}
/**
- * Gets the specified Samza property for a SystemStream. A Samza property
is a property that controls how Samza
- * interacts with the stream, as opposed to a property of the stream itself.
- *
- * Note, because the translation is not perfect between SystemStream and
streamId,
- * this method is not identical to getProperty(streamId, property)
- *
- * @param systemStream the SystemStream for which the property value will
be retrieved.
- * @param property the samza property name excluding the leading delimiter.
e.g. "samza.x.y"
- */
- protected def getSamzaProperty(systemStream: SystemStream, property:
String): String = {
+ * Gets the specified Samza property for a SystemStream. A Samza property is
a property that controls how Samza
+ * interacts with the stream, as opposed to a property of the stream itself.
+ *
+ * First, tries to map the systemStream to a streamId. This will only find a
streamId if the stream is a physical name
+ * (explicitly mapped physical name or a stream id without a physical name
mapping). That means this will not map a
+ * stream id to itself if there is a mapping from the stream id to a
physical stream name. This also requires that the
+ * stream id is mapped to a system in the config.
+ * If a stream id is found:
+ * 1) Look for "streams.{streamId}.{property}" for the stream id.
+ * 2) Otherwise, look for
"systems.{systemName}.streams.{streamName}.{property}" in which the systemName
is the system
+ * mapped to the stream id and the streamName is the physical stream name
for the stream id.
+ * 3) Otherwise, look for "systems.{systemName}.default.stream.{property}"
in which the systemName is the system
+ * mapped to the stream id.
+ * If a stream id was not found or no property could be found using the
above keys:
+ * 1) Look for "systems.{systemName}.streams.{streamName}.{property}" in
which the systemName is the system in the
+ * input systemStream and the streamName is the stream from the input
systemStream.
+ * 2) Otherwise, look for "systems.{systemName}.default.stream.{property}"
in which the systemName is the system
+ * in the input systemStream.
+ *
+ * @param systemStream the SystemStream for which the property value will be
retrieved.
+ * @param property the samza property name excluding the leading delimiter.
e.g. "samza.x.y"
Review comment:
this is not clear. Does the 'property' argument contain the 'samza.' part?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services