|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +#pragma once |
| 21 | + |
| 22 | +#include <cstddef> |
| 23 | +#include <cstdint> |
| 24 | + |
| 25 | +#include "iceberg/iceberg_export.h" |
| 26 | + |
| 27 | +/// \file iceberg/util/bucket_util_internal.h |
| 28 | +/// \brief Internal entry points for the bucket transform. |
| 29 | + |
| 30 | +namespace iceberg::internal { |
| 31 | + |
| 32 | +/// \brief Hash `len` bytes starting at `data` using MurmurHash3. |
| 33 | +/// |
| 34 | +/// The raw pointer and length are taken separately so that a length that does not |
| 35 | +/// fit the pointee object can be passed without forming an invalid `std::span`. |
| 36 | +/// `BucketUtils::HashBytes` forwards to this function. |
| 37 | +/// |
| 38 | +/// \param data Pointer to the first byte to hash. It is only dereferenced once `len` |
| 39 | +/// is accepted, so it may be null when the call is expected to be rejected. |
| 40 | +/// \param len The number of bytes to hash. |
| 41 | +/// \return A 32-bit hash value. |
| 42 | +/// \throws IcebergError if `len` exceeds `INT32_MAX`; see `BucketUtils::HashBytes`. |
| 43 | +ICEBERG_EXPORT int32_t HashBytes(const uint8_t* data, size_t len); |
| 44 | + |
| 45 | +} // namespace iceberg::internal |
0 commit comments