-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate common sharding metadata methods from sharding key methods
It would be more efficient to get sharding keys and sharding functions from storage in one `fetch_on_storage` function call. So, this function is common for sharding keys and sharding functions support. As well as functions for fetching on router. These methods are introduced in `sharding_metadata` module. Methods for working with sharding key structure are introduced in sharding key module. Part of #237
- Loading branch information
Showing
14 changed files
with
134 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
local fiber = require('fiber') | ||
|
||
local sharding_key_cache = {} | ||
local sharding_metadata_cache = {} | ||
|
||
sharding_key_cache.sharding_key_as_index_obj_map = nil | ||
sharding_key_cache.fetch_lock = fiber.channel(1) | ||
sharding_key_cache.is_part_of_pk = {} | ||
sharding_metadata_cache.SHARDING_KEY_MAP_NAME = "sharding_key_as_index_obj_map" | ||
sharding_metadata_cache[sharding_metadata_cache.SHARDING_KEY_MAP_NAME] = nil | ||
sharding_metadata_cache.fetch_lock = fiber.channel(1) | ||
sharding_metadata_cache.is_part_of_pk = {} | ||
|
||
function sharding_key_cache.drop_caches() | ||
sharding_key_cache.sharding_key_as_index_obj_map = nil | ||
if sharding_key_cache.fetch_lock ~= nil then | ||
sharding_key_cache.fetch_lock:close() | ||
function sharding_metadata_cache.drop_caches() | ||
sharding_metadata_cache[sharding_metadata_cache.SHARDING_KEY_MAP_NAME] = nil | ||
if sharding_metadata_cache.fetch_lock ~= nil then | ||
sharding_metadata_cache.fetch_lock:close() | ||
end | ||
sharding_key_cache.fetch_lock = fiber.channel(1) | ||
sharding_key_cache.is_part_of_pk = {} | ||
sharding_metadata_cache.fetch_lock = fiber.channel(1) | ||
sharding_metadata_cache.is_part_of_pk = {} | ||
end | ||
|
||
return sharding_key_cache | ||
return sharding_metadata_cache |
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,9 @@ | ||
local sharding_metadata_module = require('crud.common.sharding.sharding_metadata') | ||
|
||
local sharding_key_cache = {} | ||
|
||
function sharding_key_cache.update_cache(space_name) | ||
return sharding_metadata_module.update_sharding_key_cache(space_name) | ||
end | ||
|
||
return sharding_key_cache |
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
Oops, something went wrong.