-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local space_no = 0 | ||
|
||
function find_filters_by_regex(regex) | ||
if box.cfg.replication_source == nil then error("replica api only") end | ||
|
||
local cnt = 0 | ||
local t = {} | ||
for tpl in box.space[space_no].index[0]:iterator(box.index.ALL) do | ||
|
||
if string.find(tpl[1], regex) then | ||
table.insert(t, tpl) | ||
end | ||
|
||
cnt = cnt + 1 | ||
if cnt == 1000 then | ||
box.fiber.testcancel() | ||
box.fiber.sleep(0) | ||
cnt = 0 | ||
end | ||
|
||
end | ||
|
||
return unpack(t) | ||
end |