You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by xi...@apache.org on 2018/05/18 19:31:50 UTC
samza git commit: Implementing the fetchSinkInfo in
ConfigBasedIOResolver
Repository: samza
Updated Branches:
refs/heads/master 3b9e14be3 -> 171793b69
Implementing the fetchSinkInfo in ConfigBasedIOResolver
1. I think we missed implementing the fetchSinkInfo method in the ConfigBasedResolver when the API was introduced which is breaking the samza sql console tool. This fixes it.
2. latest release of mac removed realpath so the command line tools are broken. Removed the usage of realpath to fix these tools.
Thanks to nickpan47 for identifying these problems.
Author: Srinivasulu Punuru <sp...@linkedin.com>
Reviewers: Yi Pan <ni...@gmail.com>
Closes #528 from srinipunuru/release-fix.1
Project: http://git-wip-us.apache.org/repos/asf/samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/171793b6
Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/171793b6
Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/171793b6
Branch: refs/heads/master
Commit: 171793b69b33081fc6277c9505b3055f79fcb4b7
Parents: 3b9e14b
Author: Srinivasulu Punuru <sp...@linkedin.com>
Authored: Fri May 18 12:31:44 2018 -0700
Committer: xiliu <xi...@linkedin.com>
Committed: Fri May 18 12:31:44 2018 -0700
----------------------------------------------------------------------
.../samza/sql/impl/ConfigBasedIOResolverFactory.java | 13 ++++++++-----
samza-tools/scripts/eh-consumer.sh | 2 +-
samza-tools/scripts/generate-kafka-events.sh | 2 +-
samza-tools/scripts/samza-sql-console.sh | 2 +-
4 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/samza/blob/171793b6/samza-sql/src/main/java/org/apache/samza/sql/impl/ConfigBasedIOResolverFactory.java
----------------------------------------------------------------------
diff --git a/samza-sql/src/main/java/org/apache/samza/sql/impl/ConfigBasedIOResolverFactory.java b/samza-sql/src/main/java/org/apache/samza/sql/impl/ConfigBasedIOResolverFactory.java
index 0887dc4..c604e71 100644
--- a/samza-sql/src/main/java/org/apache/samza/sql/impl/ConfigBasedIOResolverFactory.java
+++ b/samza-sql/src/main/java/org/apache/samza/sql/impl/ConfigBasedIOResolverFactory.java
@@ -19,7 +19,6 @@
package org.apache.samza.sql.impl;
-import org.apache.commons.lang.NotImplementedException;
import org.apache.samza.SamzaException;
import org.apache.samza.config.Config;
import org.apache.samza.operators.TableDescriptor;
@@ -62,7 +61,11 @@ public class ConfigBasedIOResolverFactory implements SqlIOResolverFactory {
@Override
public SqlIOConfig fetchSourceInfo(String source) {
- String[] sourceComponents = source.split("\\.");
+ return fetchSystemInfo(source);
+ }
+
+ private SqlIOConfig fetchSystemInfo(String name) {
+ String[] sourceComponents = name.split("\\.");
boolean isTable = isTable(sourceComponents);
// This source resolver expects sources of format {systemName}.{streamName}[.$table]
@@ -86,7 +89,7 @@ public class ConfigBasedIOResolverFactory implements SqlIOResolverFactory {
}
if (invalidQuery) {
- String msg = String.format("Source %s is not of the format {systemName}.{streamName}[.%s]", source,
+ String msg = String.format("Source %s is not of the format {systemName}.{streamName}[.%s]", name,
SAMZA_SQL_QUERY_TABLE_KEYWORD);
LOG.error(msg);
throw new SamzaException(msg);
@@ -97,7 +100,7 @@ public class ConfigBasedIOResolverFactory implements SqlIOResolverFactory {
TableDescriptor tableDescriptor = null;
if (isTable) {
- tableDescriptor = new RocksDbTableDescriptor("InputTable-" + source)
+ tableDescriptor = new RocksDbTableDescriptor("InputTable-" + name)
.withSerde(KVSerde.of(
new JsonSerdeV2<>(SamzaSqlCompositeKey.class),
new JsonSerdeV2<>(SamzaSqlRelMessage.class)));
@@ -108,7 +111,7 @@ public class ConfigBasedIOResolverFactory implements SqlIOResolverFactory {
@Override
public SqlIOConfig fetchSinkInfo(String sink) {
- throw new NotImplementedException("No sink support in ConfigBasedIOResolver.");
+ return fetchSystemInfo(sink);
}
private boolean isTable(String[] sourceComponents) {
http://git-wip-us.apache.org/repos/asf/samza/blob/171793b6/samza-tools/scripts/eh-consumer.sh
----------------------------------------------------------------------
diff --git a/samza-tools/scripts/eh-consumer.sh b/samza-tools/scripts/eh-consumer.sh
index 363e028..382e05a 100755
--- a/samza-tools/scripts/eh-consumer.sh
+++ b/samza-tools/scripts/eh-consumer.sh
@@ -20,7 +20,7 @@ if [ `uname` == 'Linux' ];
then
base_dir=$(readlink -f $(dirname $0))
else
- base_dir=$(realpath $(dirname $0))
+ base_dir=$(dirname $0)
fi
if [ "x$LOG4J_OPTS" = "x" ]; then
http://git-wip-us.apache.org/repos/asf/samza/blob/171793b6/samza-tools/scripts/generate-kafka-events.sh
----------------------------------------------------------------------
diff --git a/samza-tools/scripts/generate-kafka-events.sh b/samza-tools/scripts/generate-kafka-events.sh
index 858ade6..85739f0 100755
--- a/samza-tools/scripts/generate-kafka-events.sh
+++ b/samza-tools/scripts/generate-kafka-events.sh
@@ -20,7 +20,7 @@ if [ `uname` == 'Linux' ];
then
base_dir=$(readlink -f $(dirname $0))
else
- base_dir=$(realpath $(dirname $0))
+ base_dir=$(dirname $0)
fi
if [ "x$LOG4J_OPTS" = "x" ]; then
http://git-wip-us.apache.org/repos/asf/samza/blob/171793b6/samza-tools/scripts/samza-sql-console.sh
----------------------------------------------------------------------
diff --git a/samza-tools/scripts/samza-sql-console.sh b/samza-tools/scripts/samza-sql-console.sh
index 39d6930..7e7c12f 100755
--- a/samza-tools/scripts/samza-sql-console.sh
+++ b/samza-tools/scripts/samza-sql-console.sh
@@ -20,7 +20,7 @@ if [ `uname` == 'Linux' ];
then
base_dir=$(readlink -f $(dirname $0))
else
- base_dir=$(realpath $(dirname $0))
+ base_dir=$(dirname $0)
fi
if [ "x$LOG4J_OPTS" = "x" ]; then