Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-23098

Allow Operation assertState to Accept a Collection

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      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)));
      }
      

      By allowing assertState to accept a Collection, one can save an allocation and simplify the code:

          assertState(Collections.singleton(OperationState.FINISHED));
      

        Attachments

        1. HIVE-23098.3.patch
          15 kB
          David Mollitor
        2. HIVE-23098.2.patch
          16 kB
          David Mollitor
        3. HIVE-23098.2.patch
          16 kB
          David Mollitor
        4. HIVE-23098.2.patch
          16 kB
          David Mollitor
        5. HIVE-23098.1.patch
          16 kB
          David Mollitor

          Issue Links

            Activity

              People

              • Assignee:
                belugabehr David Mollitor
                Reporter:
                belugabehr David Mollitor
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: