Skip to content

Commit

Permalink
Refactor compression file organization
Browse files Browse the repository at this point in the history
Move compression dml code into separate file, moves code dealing
with ScanKey into separate file and move compression algorithms code
into dedicated subdirectory.
  • Loading branch information
svenklemm committed Jul 4, 2024
1 parent 731c800 commit c10fae7
Show file tree
Hide file tree
Showing 28 changed files with 1,858 additions and 1,794 deletions.
9 changes: 4 additions & 5 deletions tsl/src/compression/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/api.c
${CMAKE_CURRENT_SOURCE_DIR}/array.c
${CMAKE_CURRENT_SOURCE_DIR}/compression.c
${CMAKE_CURRENT_SOURCE_DIR}/compression_dml.c
${CMAKE_CURRENT_SOURCE_DIR}/compression_scankey.c
${CMAKE_CURRENT_SOURCE_DIR}/compression_storage.c
${CMAKE_CURRENT_SOURCE_DIR}/create.c
${CMAKE_CURRENT_SOURCE_DIR}/datum_serialize.c
${CMAKE_CURRENT_SOURCE_DIR}/deltadelta.c
${CMAKE_CURRENT_SOURCE_DIR}/dictionary.c
${CMAKE_CURRENT_SOURCE_DIR}/gorilla.c
${CMAKE_CURRENT_SOURCE_DIR}/segment_meta.c)
target_sources(${TSL_LIBRARY_NAME} PRIVATE ${SOURCES})

add_subdirectory(algorithms)
7 changes: 7 additions & 0 deletions tsl/src/compression/algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/array.c
${CMAKE_CURRENT_SOURCE_DIR}/datum_serialize.c
${CMAKE_CURRENT_SOURCE_DIR}/deltadelta.c
${CMAKE_CURRENT_SOURCE_DIR}/dictionary.c
${CMAKE_CURRENT_SOURCE_DIR}/gorilla.c)
target_sources(${TSL_LIBRARY_NAME} PRIVATE ${SOURCES})
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include <utils/lsyscache.h>
#include <utils/syscache.h>

#include "compression/array.h"
#include "array.h"
#include "compression/compression.h"
#include "compression/simple8b_rle.h"
#include "compression/simple8b_rle_bitmap.h"
#include "datum_serialize.h"
#include "simple8b_rle.h"
#include "simple8b_rle_bitmap.h"

#include "compression/arrow_c_data_interface.h"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
#include <utils/syscache.h>
#include <utils/typcache.h>

#include "compat/compat.h"
#include <compat/compat.h>
#include "datum_serialize.h"

#include "compression.h"
#include <compression/compression.h>

typedef struct DatumSerializer
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* LICENSE-TIMESCALE for a copy of the license.
*/

#include "compression/deltadelta.h"
#include "deltadelta.h"

#include <access/htup_details.h>
#include <catalog/pg_aggregate.h>
Expand All @@ -22,8 +22,8 @@

#include "compression/arrow_c_data_interface.h"
#include "compression/compression.h"
#include "compression/simple8b_rle.h"
#include "compression/simple8b_rle_bitmap.h"
#include "simple8b_rle.h"
#include "simple8b_rle_bitmap.h"

static uint64 zig_zag_encode(uint64 value);
static uint64 zig_zag_decode(uint64 value);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
#include <utils/syscache.h>
#include <utils/typcache.h>

#include "compression/array.h"
#include "array.h"
#include "compression/arrow_c_data_interface.h"
#include "compression/compression.h"
#include "compression/datum_serialize.h"
#include "compression/dictionary.h"
#include "compression/dictionary_hash.h"
#include "compression/simple8b_rle.h"
#include "compression/simple8b_rle_bitmap.h"
#include "datum_serialize.h"
#include "dictionary.h"
#include "dictionary_hash.h"
#include "simple8b_rle.h"
#include "simple8b_rle_bitmap.h"

/*
* A compression bitmap is stored as
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
#include <utils/builtins.h>
#include <utils/memutils.h>

#include "compression/gorilla.h"
#include "gorilla.h"

#include "adts/bit_array.h"
#include "compression/arrow_c_data_interface.h"
#include "compression/compression.h"
#include "compression/simple8b_rle.h"
#include "compression/simple8b_rle_bitmap.h"
#include "float_utils.h"
#include "simple8b_rle.h"
#include "simple8b_rle_bitmap.h"

/*
* Gorilla compressed data is stored as
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* elements are only 0 and 1. It also counts the number of ones.
*/

#include "compression/simple8b_rle.h"
#include "simple8b_rle.h"

typedef struct Simple8bRleBitmap
{
Expand Down
Loading

0 comments on commit c10fae7

Please sign in to comment.