17 #include "gtest/gtest_prod.h"
73 const BucketHandle handle,
const std::string &name =
"");
98 void Add(
const void *buf,
const uint64_t buf_size);
138 namespace ObjectPackBuild {
186 const std::string &file_name =
"");
187 unsigned ProduceNext(
const unsigned buf_size,
unsigned char *buf);
233 const unsigned expected_header_size);
235 const unsigned char *buf);
259 const unsigned char *buf);
313 #endif // CVMFS_PACK_H_
Event(const shash::Any &id, uint64_t size, unsigned buf_size, const void *buf, ObjectPack::BucketContentType type, const std::string &name)
unsigned char accumulator_[kAccuSize]
ObjectPackConsumer(const shash::Any &expected_digest, const unsigned expected_header_size)
void TransferBucket(const BucketHandle handle, ObjectPack *other)
void Add(const void *buf, const uint64_t buf_size)
static const uint64_t kMaxObjects
const shash::Any & BucketId(size_t idx) const
ObjectPackProducer(ObjectPack *pack)
unsigned char * BucketContent(size_t idx) const
static const unsigned kInitialSize
unsigned expected_header_size_
static const unsigned kAccuSize
static const uint64_t kDefaultLimit
ObjectPackBuild::State ConsumePayload(const unsigned buf_size, const unsigned char *buf)
uint64_t BucketSize(size_t idx) const
ObjectPackBuild::State ConsumeNext(const unsigned buf_size, const unsigned char *buf)
BucketContentType content_type
std::vector< IndexEntry > index_
std::vector< BucketHandle > buckets_
void GetDigest(shash::Any *hash)
void DiscardBucket(const BucketHandle handle)
bool ParseItem(const std::string &line, IndexEntry *entry, uint64_t *sum_size)
ObjectPack::BucketContentType object_type
std::set< BucketHandle > open_buckets_
ObjectPack::BucketContentType entry_type
ObjectPack(const uint64_t limit=kDefaultLimit)
IndexEntry(const shash::Any &id, const uint64_t size, ObjectPack::BucketContentType type, const std::string &name)
bool CommitBucket(const BucketContentType type, const shash::Any &id, const BucketHandle handle, const std::string &name="")
static void AddToBucket(const void *buf, const uint64_t size, const BucketHandle handle)
size_t GetNoObjects() const
ObjectPackBuild::State state_
unsigned ProduceNext(const unsigned buf_size, unsigned char *buf)
shash::Any expected_digest_
FRIEND_TEST(T_Pack, Bucket)