You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/03/27 19:05:00 UTC
[jira] [Assigned] (HIVE-23098) Allow Operation assertState to
Accept a Collection
[ https://issues.apache.org/jira/browse/HIVE-23098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Mollitor reassigned HIVE-23098:
-------------------------------------
> Allow Operation assertState to Accept a Collection
> --------------------------------------------------
>
> Key: HIVE-23098
> URL: https://issues.apache.org/jira/browse/HIVE-23098
> Project: Hive
> Issue Type: Improvement
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
> Attachments: HIVE-23098.1.patch
>
>
> {code:java|title=Operation.java}
> protected final void assertState(List<OperationState> states) throws HiveSQLException {
> if (!states.contains(state)) {
> throw new HiveSQLException("Expected states: " + states.toString() + ", but found "
> + this.state);
> }
> this.lastAccessTime = System.currentTimeMillis();
> }
> /*********************/
> public void someMethod() {
> assertState(new ArrayList<OperationState>(Arrays.asList(OperationState.FINISHED)));
> }
> {code}
> By allowing {{assertState}} to accept a {{Collection}}, one can save an allocation and simplify the code:
> {code:java}
> assertState(Collections.singleton(OperationState.FINISHED));
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)