You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Gwen Shapira <gs...@cloudera.com> on 2014/12/19 02:56:17 UTC

Review Request 29231: Patch for KAFKA-1824

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/
-----------------------------------------------------------

Review request for kafka.


Bugs: KAFKA-1824
    https://issues.apache.org/jira/browse/KAFKA-1824


Repository: kafka


Description
-------

fixing accidental return of "WARN Property topic is not valid"


Diffs
-----

  core/src/main/scala/kafka/tools/ConsoleProducer.scala 1061cc74fac69693836f1e75add06b09d459a764 

Diff: https://reviews.apache.org/r/29231/diff/


Testing
-------


Thanks,

Gwen Shapira


Re: Review Request 29231: Patch for KAFKA-1824

Posted by Gwen Shapira <gs...@cloudera.com>.

> On Dec. 19, 2014, 2:36 a.m., Eric Olander wrote:
> > core/src/main/scala/kafka/tools/ConsoleProducer.scala, line 269
> > <https://reviews.apache.org/r/29231/diff/1/?file=797000#file797000line269>
> >
> >     remove() returns the value assigned to the key being removed, so you could simply do:
> >     
> >     topic = props.remove("topic")
> >     
> >     instead of the getProperty() and remove()

Will do. Thanks for the tip, Eric :)


- Gwen


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/#review65582
-----------------------------------------------------------


On Dec. 19, 2014, 1:56 a.m., Gwen Shapira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29231/
> -----------------------------------------------------------
> 
> (Updated Dec. 19, 2014, 1:56 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1824
>     https://issues.apache.org/jira/browse/KAFKA-1824
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> fixing accidental return of "WARN Property topic is not valid"
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/tools/ConsoleProducer.scala 1061cc74fac69693836f1e75add06b09d459a764 
> 
> Diff: https://reviews.apache.org/r/29231/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gwen Shapira
> 
>


Re: Review Request 29231: Patch for KAFKA-1824

Posted by Eric Olander <ol...@gmail.com>.

> On Dec. 19, 2014, 2:36 a.m., Eric Olander wrote:
> > core/src/main/scala/kafka/tools/ConsoleProducer.scala, line 269
> > <https://reviews.apache.org/r/29231/diff/1/?file=797000#file797000line269>
> >
> >     remove() returns the value assigned to the key being removed, so you could simply do:
> >     
> >     topic = props.remove("topic")
> >     
> >     instead of the getProperty() and remove()
> 
> Gwen Shapira wrote:
>     Will do. Thanks for the tip, Eric :)

So, I forgot that the underlying implementation of Properties is stupid - it is HashMap<Object, Object> instead of HashMap<String, String> which its API covers for. So, the remove() is going to return an Object rather than a String, so you'd have to add a cast to handle that.  Anyway, that might be more convoluted than what you have.  And I'm sure moving away from using Properties is a far more invasive change.  So, sorry to have sent you donw that rabbit hole.


- Eric


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/#review65582
-----------------------------------------------------------


On Dec. 19, 2014, 1:56 a.m., Gwen Shapira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29231/
> -----------------------------------------------------------
> 
> (Updated Dec. 19, 2014, 1:56 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1824
>     https://issues.apache.org/jira/browse/KAFKA-1824
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> fixing accidental return of "WARN Property topic is not valid"
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/tools/ConsoleProducer.scala 1061cc74fac69693836f1e75add06b09d459a764 
> 
> Diff: https://reviews.apache.org/r/29231/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gwen Shapira
> 
>


Re: Review Request 29231: Patch for KAFKA-1824

Posted by Eric Olander <ol...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/#review65582
-----------------------------------------------------------



core/src/main/scala/kafka/tools/ConsoleProducer.scala
<https://reviews.apache.org/r/29231/#comment108830>

    remove() returns the value assigned to the key being removed, so you could simply do:
    
    topic = props.remove("topic")
    
    instead of the getProperty() and remove()


- Eric Olander


On Dec. 19, 2014, 1:56 a.m., Gwen Shapira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29231/
> -----------------------------------------------------------
> 
> (Updated Dec. 19, 2014, 1:56 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1824
>     https://issues.apache.org/jira/browse/KAFKA-1824
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> fixing accidental return of "WARN Property topic is not valid"
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/tools/ConsoleProducer.scala 1061cc74fac69693836f1e75add06b09d459a764 
> 
> Diff: https://reviews.apache.org/r/29231/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gwen Shapira
> 
>


Re: Review Request 29231: Patch for KAFKA-1824

Posted by Gwen Shapira <gs...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/
-----------------------------------------------------------

(Updated Feb. 27, 2015, 7:05 a.m.)


Review request for kafka.


Bugs: KAFKA-1824
    https://issues.apache.org/jira/browse/KAFKA-1824


Repository: kafka


Description (updated)
-------

fixing accidental return of "WARN Property topic is not valid"


refactoring ConsoleProducer to allow testing and added unit tests


added producer-properties to ConsoleProducer but no tests yet


fixing an issue with producer properties.


Merge branch 'trunk' of http://git-wip-us.apache.org/repos/asf/kafka into fix_console_producer

Conflicts:
	core/src/main/scala/kafka/tools/ConsoleProducer.scala


Diffs (updated)
-----

  core/src/main/scala/kafka/tools/ConsoleProducer.scala 7fefc2ed6fed18bd172e35fc98b10e1207781e92 
  core/src/test/scala/kafka/tools/ConsoleProducerTest.scala PRE-CREATION 

Diff: https://reviews.apache.org/r/29231/diff/


Testing
-------


Thanks,

Gwen Shapira


Re: Review Request 29231: Patch for KAFKA-1824

Posted by Gwen Shapira <gs...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29231/
-----------------------------------------------------------

(Updated Dec. 23, 2014, 12:17 a.m.)


Review request for kafka.


Bugs: KAFKA-1824
    https://issues.apache.org/jira/browse/KAFKA-1824


Repository: kafka


Description (updated)
-------

fixing accidental return of "WARN Property topic is not valid"


refactoring ConsoleProducer to allow testing and added unit tests


Diffs (updated)
-----

  core/src/main/scala/kafka/tools/ConsoleProducer.scala 1061cc74fac69693836f1e75add06b09d459a764 
  core/src/test/scala/kafka/tools/ConsoleProducerTest.scala PRE-CREATION 

Diff: https://reviews.apache.org/r/29231/diff/


Testing
-------


Thanks,

Gwen Shapira