[ 
https://issues.apache.org/jira/browse/SPARK-7745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14551412#comment-14551412
 ] 

Sean Owen commented on SPARK-7745:
----------------------------------

I tend to agree. There aren't many uses of the assert keyword in the code, so 
it wouldn't be a big change.
assert is appropriate if narrowly used to assert a condition that can't happen 
no matter what the state of the world unless the program is faulty. Most uses 
of assert aren't that. It isn't for argument checking. Have a pass and see if 
any are legitimately not real asserts.

> Replace assertions with requires (IllegalArgumentException) and modify other 
> state checks
> -----------------------------------------------------------------------------------------
>
>                 Key: SPARK-7745
>                 URL: https://issues.apache.org/jira/browse/SPARK-7745
>             Project: Spark
>          Issue Type: Improvement
>          Components: Streaming
>            Reporter: Burak Yavuz
>            Priority: Minor
>
> Assertions can be turned off. Require throws an IllegalArgumentException, 
> which makes more sense, when it's a variable set by the user. Also, some 
> SparkException's can be changed to IllegalStateExceptions for the streaming 
> spark context state checks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to