3232#include " utils/blob.h"
3333#include " utils/endians.h"
3434#include " utils/fmt_logging.h"
35- #include " absl/strings/ string_view.h "
35+ #include < string_view>
3636#include " value_field.h"
3737
3838namespace pegasus {
@@ -55,7 +55,7 @@ inline uint64_t extract_timestamp_from_timetag(uint64_t timetag)
5555// / Extracts expire_ts from rocksdb value with given version.
5656// / The value schema must be in v0 or v1.
5757// / \return expire_ts in host endian
58- inline uint32_t pegasus_extract_expire_ts (uint32_t version, absl ::string_view value)
58+ inline uint32_t pegasus_extract_expire_ts (uint32_t version, std ::string_view value)
5959{
6060 CHECK_LE (version, PEGASUS_DATA_VERSION_MAX);
6161 return dsn::data_input (value).read_u32 ();
@@ -76,15 +76,15 @@ pegasus_extract_user_data(uint32_t version, std::string &&raw_value, ::dsn::blob
7676 if (version == 1 ) {
7777 input.skip (sizeof (uint64_t ));
7878 }
79- absl ::string_view view = input.read_str ();
79+ std ::string_view view = input.read_str ();
8080
8181 // tricky code to avoid memory copy
8282 std::shared_ptr<char > buf (const_cast <char *>(view.data ()), [s](char *) { delete s; });
8383 user_data.assign (std::move (buf), 0 , static_cast <unsigned int >(view.length ()));
8484}
8585
8686// / Extracts timetag from a v1 value.
87- inline uint64_t pegasus_extract_timetag (int version, absl ::string_view value)
87+ inline uint64_t pegasus_extract_timetag (int version, std ::string_view value)
8888{
8989 CHECK_EQ (version, 1 );
9090
@@ -118,7 +118,7 @@ inline bool check_if_ts_expired(uint32_t epoch_now, uint32_t expire_ts)
118118// / \return true if expired
119119inline bool check_if_record_expired (uint32_t value_schema_version,
120120 uint32_t epoch_now,
121- absl ::string_view raw_value)
121+ std ::string_view raw_value)
122122{
123123 return check_if_ts_expired (epoch_now,
124124 pegasus_extract_expire_ts (value_schema_version, raw_value));
@@ -136,7 +136,7 @@ class pegasus_value_generator
136136 // / A higher level utility for generating value with given version.
137137 // / The value schema must be in v0 or v1.
138138 rocksdb::SliceParts generate_value (uint32_t value_schema_version,
139- absl ::string_view user_data,
139+ std ::string_view user_data,
140140 uint32_t expire_ts,
141141 uint64_t timetag)
142142 {
@@ -157,7 +157,7 @@ class pegasus_value_generator
157157 // /
158158 // / rocksdb value (ver 0) = [expire_ts(uint32_t)] [user_data(bytes)]
159159 // / \internal
160- rocksdb::SliceParts generate_value_v0 (uint32_t expire_ts, absl ::string_view user_data)
160+ rocksdb::SliceParts generate_value_v0 (uint32_t expire_ts, std ::string_view user_data)
161161 {
162162 _write_buf.resize (sizeof (uint32_t ));
163163 _write_slices.clear ();
@@ -210,7 +210,7 @@ class pegasus_value_generator
210210 // /
211211 // / \internal
212212 rocksdb::SliceParts
213- generate_value_v1 (uint32_t expire_ts, uint64_t timetag, absl ::string_view user_data)
213+ generate_value_v1 (uint32_t expire_ts, uint64_t timetag, std ::string_view user_data)
214214 {
215215 _write_buf.resize (sizeof (uint32_t ) + sizeof (uint64_t ));
216216 _write_slices.clear ();
@@ -258,7 +258,7 @@ class value_schema
258258public:
259259 virtual ~value_schema () = default ;
260260
261- virtual std::unique_ptr<value_field> extract_field (absl ::string_view value,
261+ virtual std::unique_ptr<value_field> extract_field (std ::string_view value,
262262 value_field_type type) = 0;
263263 // / Extracts user value from the raw rocksdb value.
264264 // / In order to avoid data copy, the ownership of `raw_value` will be transferred
0 commit comments