Get the proper bucket for some input row.

@param inputRow an InputRow

@return the Bucket that this row belongs to
549972
public Optional<Bucket> getBucket(InputRow inputRow)
  {
    final Optional<Interval> timeBucket = schema.getDataSchema().getGranularitySpec().bucketInterval(
        DateTimes.utc(inputRow.getTimestampFromEpoch())
    );
    if (!timeBucket.isPresent()) {
      return Optional.absent();
    }
    final DateTime bucketStart = timeBucket.get().getStart();
    final ShardSpec actualSpec = shardSpecLookups.get(bucketStart.getMillis())
                                                 .getShardSpec(
                                                     rollupGran.bucketStart(inputRow.getTimestamp()).getMillis(),
                                                     inputRow
                                                 );
    final HadoopyShardSpec hadoopyShardSpec = hadoopShardSpecLookup.get(bucketStart.getMillis()).get(actualSpec);

    return Optional.of(
        new Bucket(
            hadoopyShardSpec.getShardNum(),
            bucketStart,
            actualSpec.getPartitionNum()
        )
    );

  }
735888
public java.util.List<Bucket> getBuckets() {
        if (buckets == null) {
            buckets = new com.amazonaws.internal.SdkInternalList<Bucket>();
        }
        return buckets;
    }
367841
protected static ArrayList getSoilLayer(HashMap data) {
        if (data.containsKey("soil") || !data.containsKey("soilLayer")) {
            return MapUtil.getBucket(data, "soil").getDataList();
        } else {
            return new BucketEntry(data).getDataList();
        }
    }
136430
@Override
	public final Object getValueAt(final int row, final int col) {
		TableTreeNode rowNode = getNodeAtLine(row);
		return getValueAt(rowNode, col);
	}
1152903
private void initBuckets() {
        if (buckets != null) {
            return;
        }
        buckets = createBucketList();
        if (inputList == null || inputList.isEmpty()) {
            return;
        }

        // Sort the records by name.
        // Stable sort preserves input order of collation duplicates.
        Collections.sort(inputList, recordComparator);

        // Now, we traverse all of the input, which is now sorted.
        // If the item doesn't go in the current bucket, we find the next bucket that contains it.
        // This makes the process order n*log(n), since we just sort the list and then do a linear process.
        // However, if the user adds an item at a time and then gets the buckets, this isn't efficient, so
        // we need to improve it for that case.

        Iterator<Bucket<V>> bucketIterator = buckets.fullIterator();
        Bucket<V> currentBucket = bucketIterator.next();
        Bucket<V> nextBucket;
        String upperBoundary;
        if (bucketIterator.hasNext()) {
            nextBucket = bucketIterator.next();
            upperBoundary = nextBucket.lowerBoundary;
        } else {
            nextBucket = null;
            upperBoundary = null;
        }
        for (Record<V> r : inputList) {
            // if the current bucket isn't the right one, find the one that is
            // We have a special flag for the last bucket so that we don't look any further
            while (upperBoundary != null &&
                    collatorPrimaryOnly.compare(r.name, upperBoundary) >= 0) {
                currentBucket = nextBucket;
                // now reset the boundary that we compare against
                if (bucketIterator.hasNext()) {
                    nextBucket = bucketIterator.next();
                    upperBoundary = nextBucket.lowerBoundary;
                } else {
                    upperBoundary = null;
                }
            }
            // now put the record into the bucket.
            Bucket<V> bucket = currentBucket;
            if (bucket.displayBucket != null) {
                bucket = bucket.displayBucket;
            }
            if (bucket.records == null) {
                bucket.records = new ArrayList<Record<V>>();
            }
            bucket.records.add(r);
        }
    }
617396
public Integer getSelectedRow() {
        final Object result = getStateHelper().eval(PropertyKeys.selectedRow);
        if (result == null) {
            return null;
        }
        return Integer.valueOf(result.toString());
    }
573654
@Override
  public Row<K, N, V> peekLast() {
    return rowsList != null && rowsList.size() > 0 ? rowsList.get(rowsList.size()-1) : null;
  }
309672
public List<Row> getRowsCopy()
    {
        final List<Row> rows = new ArrayList<>(this.getRowsCount());

        for (Row cells : this)
        {
            rows.add(cells);
        }

        return rows;
    }
412487
public static HiveColumnHandle bucketColumnHandle()
    {
        return new HiveColumnHandle(BUCKET_COLUMN_NAME, BUCKET_HIVE_TYPE, BUCKET_TYPE_SIGNATURE, BUCKET_COLUMN_INDEX, SYNTHESIZED, Optional.empty());
    }
124568
public float get(int row, int col) {
        if (row < 0 || row > 3) {
            throw new IndexOutOfBoundsException("Index: " + row + ", Size: 4");
        }
        if (col < 0 || col > 3) {
            throw new IndexOutOfBoundsException("Index: " + col + ", Size: 4");
        }

        return m_data[row * 4 + col];
    }
107069
public static TransformedInputRow of(final InputRow row) {
        if (row instanceof TransformedInputRow) {
            // re-use existing transformed input row.
            return (TransformedInputRow) row;
        } else {
            return new TransformedInputRow(row, row.getId());
        }
    }
1025248
@Override
  public UnsafeRow getKeyRow(int rowId) {
    assert(rowId >= 0);
    assert(rowId < numRows);
    if (keyRowId != rowId) { // if keyRowId == rowId, desired keyRow is already cached
      long offset = getKeyOffsetForFixedLengthRecords(rowId);
      keyRow.pointTo(base, offset, klen);
      // set keyRowId so we can check if desired row is cached
      keyRowId = rowId;
    }
    return keyRow;
  }
994769
public com.google.privacy.dlp.v2.BucketingConfigOrBuilder getBucketingConfigOrBuilder() {
    if (transformationCase_ == 6) {
      return (com.google.privacy.dlp.v2.BucketingConfig) transformation_;
    }
    return com.google.privacy.dlp.v2.BucketingConfig.getDefaultInstance();
  }
508874
@Override
    public int getBucketId(byte[] key) {
        int index = searchBucketIndex(key, 0, maxRangeValues.length - 1);
        return bucketIds[index];
    }
272757
@Override
  public IndexedInts getRow()
  {
    final IndexedInts row = selector.getRow();

    if (row.size() == 1) {
      if (nullAdjustment == 0) {
        return row;
      } else {
        nullAdjustedRow.setValue(row.get(0) + nullAdjustment);
        return nullAdjustedRow;
      }
    } else {
      // Can't handle non-singly-valued rows in expressions.
      // Treat them as nulls until we think of something better to do.
      return ZeroIndexedInts.instance();
    }
  }
878344
public DynaFormRow createExtendedRow() {
        if (extendedRows == null) {
            extendedRows = new ArrayList<DynaFormRow>();
        }

        final DynaFormRow dynaFormRow = new DynaFormRow(extendedRows.size() + 1, true, this);
        extendedRows.add(dynaFormRow);

        return dynaFormRow;
    }
57400
@Override
  public CounterRow<K, N> peekLast() {
    return rowsList != null && rowsList.size() > 0 ? rowsList.get(rowsList.size()-1) : null;
  }