Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26630

TableSnapshotInputFormat terminates in the middle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.2.3
    • None
    • None
    • None

    Description

      I am using by adding SingleColumnValueFilter in TableSnapshotInputFormat. In fact, there is a lot of data in the snapshot, but it was found that the mapper was completed in the middle.

       

      There was a problem in the next method of ClientSideRegionScanner.

       

       public Result next() throws IOException {
          values.clear();
          scanner.nextRaw(values);
          if (values.isEmpty()) {
            //we are done
            return null;
          }
      
          Result result = Result.create(values);
          if (this.scanMetrics != null) {
            long resultSize = 0;
            for (Cell cell : values) {
              resultSize += PrivateCellUtil.estimatedSerializedSizeOf(cell);
            }
            this.scanMetrics.countOfBytesInResults.addAndGet(resultSize);
            this.scanMetrics.countOfRowsScanned.incrementAndGet();
          }
      
          return result;
        } 

      values is empty, but scanner.nextRaw(values) returned true.

      I modified it as follows and it worked normally.

      public Result next() throws IOException {
              values.clear();
              boolean moreValues;
              do {
                  moreValues = scanner.nextRaw(values);
              } while (values.isEmpty() && moreValues);
      
              if (!moreValues) {
                  return null;
              }
      
              Result result = Result.create(values);
              if (this.scanMetrics != null) {
                  long resultSize = 0;
                  for (Cell cell : values) {
                      resultSize += PrivateCellUtil.estimatedSerializedSizeOf(cell);
                  }
                  this.scanMetrics.countOfBytesInResults.addAndGet(resultSize);
                  this.scanMetrics.countOfRowsScanned.incrementAndGet();
              }
      
              return result;
          } 

      Please check this.

       

      Attachments

        Issue Links

          Activity

            People

              hgromer Hernan Gelaf-Romer
              dadapeng hyungseok.lim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: