aboutsummaryrefslogtreecommitdiff
path: root/icing/file/file-backed-vector.h
diff options
context:
space:
mode:
authorCassie Wang <cassiewang@google.com>2020-01-16 10:12:38 -0800
committerCassie Wang <cassiewang@google.com>2020-01-16 12:26:33 -0800
commit533fe97b018af47301d7dc1ca3fb2e3ad5ee3eb8 (patch)
tree86f3ed098a3eccd8019f0b31c3ea10e4779cf4bd /icing/file/file-backed-vector.h
parent88a9b37a20d4a601baf3b6ca0cfb1ad826dc7e29 (diff)
downloadicing-533fe97b018af47301d7dc1ca3fb2e3ad5ee3eb8.tar.gz
Pull upstream changes.
Upstream synced @290094995 Bug: 146383629 Test: manual, ran 'm -j libicing' with a local Android.bp Change-Id: I63eb12e93f3de5d6607ba7006fd3ea532dc079e4
Diffstat (limited to 'icing/file/file-backed-vector.h')
-rw-r--r--icing/file/file-backed-vector.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/icing/file/file-backed-vector.h b/icing/file/file-backed-vector.h
index 05ad288..f13b67b 100644
--- a/icing/file/file-backed-vector.h
+++ b/icing/file/file-backed-vector.h
@@ -68,7 +68,6 @@
#include "icing/text_classifier/lib3/utils/base/status.h"
#include "icing/text_classifier/lib3/utils/base/statusor.h"
#include "icing/absl_ports/canonical_errors.h"
-#include "icing/absl_ports/status_macros.h"
#include "icing/absl_ports/str_cat.h"
#include "icing/file/filesystem.h"
#include "icing/file/memory-mapped-file.h"
@@ -76,6 +75,7 @@
#include "icing/util/crc32.h"
#include "icing/util/logging.h"
#include "icing/util/math-util.h"
+#include "icing/util/status-macros.h"
namespace icing {
namespace lib {
@@ -188,6 +188,10 @@ class FileBackedVector {
libtextclassifier3::Status TruncateTo(int32_t len);
// Flushes content to underlying file.
+ //
+ // Returns:
+ // OK on success
+ // INTERNAL on I/O error
libtextclassifier3::Status PersistToDisk();
// Calculates and returns the disk usage in bytes.
@@ -670,7 +674,7 @@ libtextclassifier3::StatusOr<Crc32> FileBackedVector<T>::ComputeChecksum() {
template <typename T>
libtextclassifier3::Status FileBackedVector<T>::PersistToDisk() {
// Update and write the header
- TC3_ASSIGN_OR_RETURN(Crc32 checksum, ComputeChecksum());
+ ICING_ASSIGN_OR_RETURN(Crc32 checksum, ComputeChecksum());
header_->vector_checksum = checksum.Get();
header_->header_checksum = header_->CalculateHeaderChecksum();