Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delfi filters #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions delfi.lua
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