You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by roshannaik <gi...@git.apache.org> on 2016/07/13 00:44:25 UTC
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
GitHub user roshannaik opened a pull request:
https://github.com/apache/storm/pull/1558
STORM-1910 One topology cannot use hdfs spout to read from two locations
Changing the way the spout is configured. Using member functions as the primary mode of config... still have to supporting the older mode (via conf object ) for backward compatibility.
Updated test code.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/roshannaik/storm STORM-1910
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1558.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1558
----
commit d3ec6021eee07d0f44ce2a3464622e22e6be0c91
Author: Roshan Naik <ro...@hortonworks.com>
Date: 2016-07-13T00:39:56Z
STORM-1910 - One topology cannot use hdfs spout to read from two locations
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550149
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -357,9 +436,15 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
}
// -- lock dir config
- String lockDir = !conf.containsKey(Configs.LOCK_DIR) ? getDefaultLockDir(sourceDirPath) : conf.get(Configs.LOCK_DIR).toString() ;
+ if( lockDir==null && conf.containsKey(Configs.LOCK_DIR) ) {
--- End diff --
remove the new line after the if and space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm issue #1558: STORM-1910 One topology cannot use hdfs spout to read fro...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on the issue:
https://github.com/apache/storm/pull/1558
minor nit picks. overall looks good to me +1 after addressing the comments
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550110
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -322,33 +393,41 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
}
// Reader type config
- if( conf.containsKey(Configs.READER_TYPE) ) {
+ if( readerType==null && conf.containsKey(Configs.READER_TYPE) ) {
--- End diff --
space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550095
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -291,10 +361,11 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
this.tupleCounter = 0;
// Hdfs related settings
- if( conf.containsKey(Configs.HDFS_URI)) {
+ if(this.hdfsUri==null && conf.containsKey(Configs.HDFS_URI)) {
--- End diff --
can you space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm issue #1558: STORM-1910 One topology cannot use hdfs spout to read fro...
Posted by ptgoetz <gi...@git.apache.org>.
Github user ptgoetz commented on the issue:
https://github.com/apache/storm/pull/1558
+1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550171
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -357,9 +436,15 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
}
// -- lock dir config
- String lockDir = !conf.containsKey(Configs.LOCK_DIR) ? getDefaultLockDir(sourceDirPath) : conf.get(Configs.LOCK_DIR).toString() ;
+ if( lockDir==null && conf.containsKey(Configs.LOCK_DIR) ) {
+ lockDir = conf.get(Configs.LOCK_DIR).toString();
+ }
+ if(lockDir==null) {
--- End diff --
space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550104
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -291,10 +361,11 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
this.tupleCounter = 0;
// Hdfs related settings
- if( conf.containsKey(Configs.HDFS_URI)) {
+ if(this.hdfsUri==null && conf.containsKey(Configs.HDFS_URI)) {
this.hdfsUri = conf.get(Configs.HDFS_URI).toString();
- } else {
- throw new RuntimeException(Configs.HDFS_URI + " setting is required");
+ }
+ if(this.hdfsUri==null) {
--- End diff --
space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/storm/pull/1558
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550119
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -322,33 +393,41 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
}
// Reader type config
- if( conf.containsKey(Configs.READER_TYPE) ) {
+ if( readerType==null && conf.containsKey(Configs.READER_TYPE) ) {
readerType = conf.get(Configs.READER_TYPE).toString();
- checkValidReader(readerType);
}
+ checkValidReader(readerType);
// -- source dir config
- if ( !conf.containsKey(Configs.SOURCE_DIR) ) {
+ if ( sourceDir==null && conf.containsKey(Configs.SOURCE_DIR) ) {
+ sourceDir = conf.get(Configs.SOURCE_DIR).toString();
+ }
+ if( sourceDir==null ) {
--- End diff --
space after if
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request #1558: STORM-1910 One topology cannot use hdfs spout to r...
Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:
https://github.com/apache/storm/pull/1558#discussion_r70550209
--- Diff: external/storm-hdfs/src/main/java/org/apache/storm/hdfs/spout/HdfsSpout.java ---
@@ -357,9 +436,15 @@ public void open(Map conf, TopologyContext context, SpoutOutputCollector collect
}
// -- lock dir config
- String lockDir = !conf.containsKey(Configs.LOCK_DIR) ? getDefaultLockDir(sourceDirPath) : conf.get(Configs.LOCK_DIR).toString() ;
+ if( lockDir==null && conf.containsKey(Configs.LOCK_DIR) ) {
+ lockDir = conf.get(Configs.LOCK_DIR).toString();
+ }
+ if(lockDir==null) {
+ lockDir = getDefaultLockDir(sourceDirPath);
+ }
this.lockDirPath = new Path(lockDir);
- validateOrMakeDir(hdfs,lockDirPath,"locks");
+ validateOrMakeDir(hdfs,lockDirPath, "locks");
--- End diff --
space after hdfs,
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---