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

Allow Operation assertState to Accept a Collection

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-1
    • None
    • None

    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.1.patch
          16 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.3.patch
          15 kB
          David Mollitor

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: