Skip to content
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cfddd8b
increment route update for radixtree host uri, radixtree uri and radi…
ranxuxin001 Jun 19, 2023
455b881
Merge branch 'apache:master' into master
ranxuxin001 Jun 26, 2023
3a18a38
erase unused function and remove useless space
ranxuxin001 Jun 26, 2023
180e2a8
upgrade version of radixtree
ranxuxin001 Jun 26, 2023
2ccd28d
avoid incremental update a route while not base on config_etcd source.
ranxuxin001 Jun 26, 2023
02021f8
be compitable to ai plugin and other config source
ranxuxin001 Jun 27, 2023
6db2b6d
inform ai plugin after init config_etcd object.
ranxuxin001 Jun 27, 2023
345a190
remove redundant even.push()
ranxuxin001 Jun 27, 2023
478ecaf
fix update route from only uri to host uri while host_uri mode
ranxuxin001 Jun 27, 2023
36a7a64
move filter() content to radixtree_uri
ranxuxin001 Jul 3, 2023
bd72921
increment update a route for radixtree host uri
ranxuxin001 Jul 3, 2023
aab6bb1
remove useless file
ranxuxin001 Jul 4, 2023
46069c7
tested host uri done
ranxuxin001 Jul 4, 2023
4e167ca
improve codes for uri, uri_with_parameter
ranxuxin001 Jul 4, 2023
2098b0d
test radixtree uri done.
ranxuxin001 Jul 4, 2023
b3a9621
tested uri with parameter done
ranxuxin001 Jul 4, 2023
2ff51f7
add id in route format
ranxuxin001 Jul 5, 2023
785e7f2
comment
ranxuxin001 Jul 5, 2023
80493bd
comment
ranxuxin001 Jul 5, 2023
aa0360b
fix warnings
ranxuxin001 Jul 5, 2023
4cb466f
improve codes
ranxuxin001 Jul 6, 2023
c7dc966
coding done.
ranxuxin001 Jul 7, 2023
6dad9c9
reuse function
ranxuxin001 Jul 9, 2023
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
9 changes: 5 additions & 4 deletions apisix/core/config_etcd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ local function load_full_data(self, dir_res, headers)
item.clean_handlers = {}

if self.filter then
self.filter(item)
self.filter(item, 1, self)
end
end

Expand Down Expand Up @@ -551,7 +551,7 @@ local function load_full_data(self, dir_res, headers)
item.clean_handlers = {}

if self.filter then
self.filter(item)
self.filter(item, #values, self)
end
end

Expand Down Expand Up @@ -695,9 +695,10 @@ local function sync_data(self)
return false
end

local pre_val
local pre_index = self.values_hash[key]
if pre_index then
local pre_val = self.values[pre_index]
pre_val = self.values[pre_index]
if pre_val then
config_util.fire_all_clean_handlers(pre_val)
end
Expand Down Expand Up @@ -755,7 +756,7 @@ local function sync_data(self)
-- /plugins' filter need to known self.values when it is called
-- so the filter should be called after self.values set.
if self.filter then
self.filter(res)
self.filter(res, pre_val, self)
end

self.conf_version = self.conf_version + 1
Expand Down
7 changes: 6 additions & 1 deletion apisix/http/route.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function _M.create_radixtree_uri_router(routes, uri_routes, with_parameter)
core.log.info("insert uri route: ",
core.json.delay_encode(route.value, true))
core.table.insert(uri_routes, {
id = route.value.id,
paths = route.value.uris or route.value.uri,
methods = route.value.methods,
priority = route.value.priority,
Expand All @@ -92,7 +93,11 @@ function _M.create_radixtree_uri_router(routes, uri_routes, with_parameter)
end
end

event.push(event.CONST.BUILD_ROUTER, routes)
local router_module = require("apisix.router")
if router_module.router_http then
event.push(event.CONST.BUILD_ROUTER, routes)
end

core.log.info("route items: ", core.json.delay_encode(uri_routes, true))

if with_parameter then
Expand Down
Loading