-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move parquet buffered serializer into common/serializer
- Loading branch information
1 parent
a439404
commit e73855d
Showing
52 changed files
with
481 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
add_library(kuzu_common_serializer | ||
OBJECT | ||
serializer.cpp | ||
deserializer.cpp | ||
buffered_file.cpp | ||
buffered_serializer.cpp) | ||
|
||
set(ALL_OBJECT_FILES | ||
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:kuzu_common_serializer> | ||
PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "common/serializer/buffered_file.h" | ||
|
||
#include "common/file_utils.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
void BufferedFileWriter::flush() { | ||
FileUtils::writeToFile(fileInfo.get(), buffer.get(), bufferOffset, fileOffset); | ||
fileOffset += bufferOffset; | ||
bufferOffset = 0; | ||
memset(buffer.get(), 0, BUFFER_SIZE); | ||
} | ||
|
||
void BufferedFileReader::readNextPage() { | ||
FileUtils::readFromFile(fileInfo.get(), buffer.get(), BUFFER_SIZE, fileOffset); | ||
fileOffset += BUFFER_SIZE; | ||
bufferOffset = 0; | ||
} | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "common/serializer/deserializer.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
|
||
template<> | ||
void Deserializer::deserializeValue(std::string& value) { | ||
uint64_t valueLength = 0; | ||
deserializeValue(valueLength); | ||
value.resize(valueLength); | ||
reader->read((uint8_t*)value.data(), valueLength); | ||
} | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "common/file_utils.h" | ||
#include "common/serializer/buffered_file.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
|
||
void BufferedFileWriter::flush() { | ||
FileUtils::writeToFile(fileInfo.get(), buffer.get(), bufferOffset, fileOffset); | ||
fileOffset += bufferOffset; | ||
bufferOffset = 0; | ||
memset(buffer.get(), 0, BUFFER_SIZE); | ||
} | ||
|
||
void BufferedFileReader::readNextPage() { | ||
FileUtils::readFromFile(fileInfo.get(), buffer.get(), BUFFER_SIZE, fileOffset); | ||
fileOffset += BUFFER_SIZE; | ||
bufferOffset = 0; | ||
} | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "common/serializer/serializer.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
|
||
template<> | ||
void Serializer::serializeValue(const std::string& value) { | ||
uint64_t valueLength = value.length(); | ||
writer->write((uint8_t*)&valueLength, sizeof(uint64_t)); | ||
writer->write((uint8_t*)value.data(), valueLength); | ||
} | ||
|
||
} // namespace common | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.