HBase
  1. HBase
  2. HBASE-10064

AggregateClient.validateParameters can throw NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.14
    • Fix Version/s: 0.94.15
    • Component/s: Client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When using methods such as max(...), min(...) in AggregationClient, we will pass Scan as parameter. These methods will throw NullPointerException if users invoke scan.setStartRow(null) or scan.setStopRow(null) before passing the scan as parameter. The NullPointerException is thrown by validateParameters(Scan scan) which will be invoked before sending requests to server. The implementation of validateParameters is :

        private void validateParameters(Scan scan) throws IOException {
          if (scan == null
              || (Bytes.equals(scan.getStartRow(), scan.getStopRow()) && !Bytes
                  .equals(scan.getStartRow(), HConstants.EMPTY_START_ROW))
              || ((Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0) &&
              	!Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW))) {
            throw new IOException(
                "Agg client Exception: Startrow should be smaller than Stoprow");
          } else if (scan.getFamilyMap().size() != 1) {
            throw new IOException("There must be only one family.");
          }
        }
      

      “Bytes.equals(scan.getStartRow(), HConstants.EMPTY_START_ROW)” will throw NullPointerException if the startRow of scan is set to null.

      1. HBASE-10064-0.94-v2.patch
        1 kB
        cuijianwei
      2. HBASE-10064-0.94-v1.patch
        2 kB
        cuijianwei
      3. 10064-0.94.patch
        0.7 kB
        Andrew Purtell

        Activity

        Lars Hofhansl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Andrew Purtell made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Assignee cuijianwei [ cuijianwei ]
        Fix Version/s 0.94.15 [ 12325559 ]
        Resolution Fixed [ 1 ]
        Andrew Purtell made changes -
        Attachment 10064-0.94.patch [ 12617358 ]
        Andrew Purtell made changes -
        Summary AggregateClient.validateParameters will throw NullPointerException when set startRow/stopRow of scan to null AggregateClient.validateParameters can throw NPE
        cuijianwei made changes -
        Attachment HBASE-10064-0.94-v2.patch [ 12617303 ]
        cuijianwei made changes -
        Attachment HBASE-10064-0.94-v1.patch [ 12616519 ]
        cuijianwei made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        cuijianwei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        cuijianwei created issue -

          People

          • Assignee:
            cuijianwei
            Reporter:
            cuijianwei
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development