Search documentation of macula

# macula_routing_network (macula v0.44.2)

View Source

Network transport and escalation operations for DHT routing. Extracted from macula_routing_server to reduce module size. Handles peer-to-peer store propagation, network queries, bridge escalation, and value replication.

# Summary

## Functions

check_bridge_cache(Key)

Check bridge cache for value.

escalate_to_bridge(Key, Config)

Escalate query to parent bridge.

find_value_via_dht(Key, K, Table)

Query the DHT network for a value.

find_value_with_escalation(Key, K, Storage, Table, Config)

Find value with escalation support.

maybe_escalate_query(Key, Config)

Escalate query to parent bridge if enabled.

network_query_find_value(NodeInfo, Key)

Network query function for FIND_VALUE.

propagate_store_to_peers(ClosestNodes, StoreMsg, Key, Value)

Propagate STORE message to peers (called in spawned process).

replicate_to_new_peer(NewNodeInfo, Storage, Table, Config)

Replicate stored values to a newly joined peer.

send_store_to_peer(NodeInfo, StoreMsg)

Send store message to a peer (best effort).

# Functions

# check_bridge_cache(Key)

    -spec check_bridge_cache(binary()) -> {ok, term()} | not_found.

Check bridge cache for value.

# escalate_to_bridge(Key, Config)

    -spec escalate_to_bridge(binary(), map()) -> {ok, term()} | {error, term()}.

Escalate query to parent bridge.

# find_value_via_dht(Key, K, Table)

    -spec find_value_via_dht(binary(), pos_integer(), macula_routing_table:routing_table()) ->
                                {ok, term()} | {error, term()}.

Query the DHT network for a value.

# find_value_with_escalation(Key, K, Storage, Table, Config)

    -spec find_value_with_escalation(binary(),
                                     pos_integer(),
                                     map(),
                                     macula_routing_table:routing_table(),
                                     map()) ->
                                        {ok, term()} | {error, term()}.

Find value with escalation support.

# maybe_escalate_query(Key, Config)

    -spec maybe_escalate_query(binary(), map()) -> {ok, term()} | {error, term()}.

Escalate query to parent bridge if enabled.

# network_query_find_value(NodeInfo, Key)

    -spec network_query_find_value(map(), binary()) -> {value, term()} | {nodes, list()}.

Network query function for FIND_VALUE.

# propagate_store_to_peers(ClosestNodes, StoreMsg, Key, Value)

    -spec propagate_store_to_peers(list(), map(), binary(), term()) -> ok.

Propagate STORE message to peers (called in spawned process).

# replicate_to_new_peer(NewNodeInfo, Storage, Table, Config)

    -spec replicate_to_new_peer(map(), map(), macula_routing_table:routing_table(), map()) -> ok.

Replicate stored values to a newly joined peer.

# send_store_to_peer(NodeInfo, StoreMsg)

    -spec send_store_to_peer(map(), map()) -> ok.

Send store message to a peer (best effort).