Skip to content
Permalink
Browse files
unnecessary
  • Loading branch information
AlexanderSaydakov committed Mar 25, 2022
1 parent f8d5a21 commit 9d64c7a52d214bbacf87892b83b173916f65b2b4
Showing 2 changed files with 1 addition and 31 deletions.
@@ -231,14 +231,6 @@ class frequent_items_sketch {
template<typename SerDe = S>
size_t get_serialized_size_bytes(const SerDe& sd = SerDe()) const;

/**
* This method serializes the sketch into a given stream in a binary form
* @param os output stream
*
* Deprecated, to be removed in the next major version
*/
void serialize(std::ostream& os) const;

/**
* This method serializes the sketch into a given stream in a binary form
* @param os output stream
@@ -251,18 +243,6 @@ class frequent_items_sketch {
// The type returned by the following serialize method
using vector_bytes = std::vector<uint8_t, typename std::allocator_traits<A>::template rebind_alloc<uint8_t>>;

/**
* This method serializes the sketch as a vector of bytes.
* An optional header can be reserved in front of the sketch.
* It is a blank space of a given size.
* This header is used in Datasketches PostgreSQL extension.
* @param header_size_bytes space to reserve in front of the sketch
* @return serialized sketch as a vector of bytes
*
* Deprecated, to be removed in the next major version
*/
vector_bytes serialize(unsigned header_size_bytes = 0) const;

/**
* This method serializes the sketch as a vector of bytes.
* An optional header can be reserved in front of the sketch.
@@ -160,11 +160,6 @@ frequent_items_sketch<T, W, H, E, S, A>::get_frequent_items(frequent_items_error
return items;
}

template<typename T, typename W, typename H, typename E, typename S, typename A>
void frequent_items_sketch<T, W, H, E, S, A>::serialize(std::ostream& os) const {
serialize(os, S());
}

template<typename T, typename W, typename H, typename E, typename S, typename A>
template<typename SerDe>
void frequent_items_sketch<T, W, H, E, S, A>::serialize(std::ostream& os, const SerDe& sd) const {
@@ -220,15 +215,10 @@ size_t frequent_items_sketch<T, W, H, E, S, A>::get_serialized_size_bytes(const
return size;
}

template<typename T, typename W, typename H, typename E, typename S, typename A>
auto frequent_items_sketch<T, W, H, E, S, A>::serialize(unsigned header_size_bytes) const -> vector_bytes {
return serialize(header_size_bytes, S());
}

template<typename T, typename W, typename H, typename E, typename S, typename A>
template<typename SerDe>
auto frequent_items_sketch<T, W, H, E, S, A>::serialize(unsigned header_size_bytes, const SerDe& sd) const -> vector_bytes {
const size_t size = header_size_bytes + get_serialized_size_bytes();
const size_t size = header_size_bytes + get_serialized_size_bytes(sd);
vector_bytes bytes(size, 0, map.get_allocator());
uint8_t* ptr = bytes.data() + header_size_bytes;
uint8_t* end_ptr = ptr + size;

0 comments on commit 9d64c7a

Please sign in to comment.