mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Upstream changes.
git-svn-id: https://leveldb.googlecode.com/svn/trunk@16 62dab493-f737-651d-591e-8d6aee1b9529
This commit is contained in:
@@ -29,9 +29,9 @@ struct Table::Rep {
|
||||
|
||||
Status Table::Open(const Options& options,
|
||||
RandomAccessFile* file,
|
||||
uint64_t size,
|
||||
Table** table) {
|
||||
*table = NULL;
|
||||
const uint64_t size = file->Size();
|
||||
if (size < Footer::kEncodedLength) {
|
||||
return Status::InvalidArgument("file is too short to be an sstable");
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class StringSource: public RandomAccessFile {
|
||||
|
||||
virtual ~StringSource() { }
|
||||
|
||||
virtual uint64_t Size() const { return contents_.size(); }
|
||||
uint64_t Size() const { return contents_.size(); }
|
||||
|
||||
virtual Status Read(uint64_t offset, size_t n, Slice* result,
|
||||
char* scratch) const {
|
||||
@@ -246,7 +246,7 @@ class TableConstructor: public Constructor {
|
||||
source_ = new StringSource(sink.contents());
|
||||
Options table_options;
|
||||
table_options.comparator = options.comparator;
|
||||
return Table::Open(table_options, source_, &table_);
|
||||
return Table::Open(table_options, source_, sink.contents().size(), &table_);
|
||||
}
|
||||
virtual size_t NumBytes() const { return source_->Size(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user