From 572323a87f3ed28ae2af42f32cbc745e35b95101 Mon Sep 17 00:00:00 2001 From: xsipewe Date: Mon, 18 May 2015 14:54:00 +0200 Subject: Update asn1 documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Language cleaned up by the technical writer xsipewe from Combitech. Proofreading and and additional corrections by Björn Gustavsson and Dan Gudmundsson. --- lib/mnesia/doc/src/mnesia_frag_hash.xml | 91 ++++++++++++++++----------------- 1 file changed, 45 insertions(+), 46 deletions(-) (limited to 'lib/mnesia/doc/src/mnesia_frag_hash.xml') diff --git a/lib/mnesia/doc/src/mnesia_frag_hash.xml b/lib/mnesia/doc/src/mnesia_frag_hash.xml index 0d660925e7..fe6d847655 100644 --- a/lib/mnesia/doc/src/mnesia_frag_hash.xml +++ b/lib/mnesia/doc/src/mnesia_frag_hash.xml @@ -34,22 +34,23 @@ mnesia_frag_hash.sgml mnesia_frag_hash - Defines mnesia_frag_hash callback behaviour + Defines mnesia_frag_hash callback behavior -

The module mnesia_frag_hash defines a callback - behaviour for user defined hash functions of fragmented tables.

+

This module defines a callback behavior for user-defined hash + functions of fragmented tables.

Which module that is selected to implement the mnesia_frag_hash - behaviour for a particular fragmented table is specified together + behavior for a particular fragmented table is specified together with the other frag_properties. The hash_module defines the module name. The hash_state defines the initial hash state.

-

It implements dynamic hashing which is a kind of hashing +

This module implements dynamic hashing, which is a kind of hashing that grows nicely when new fragments are added. It is well - suited for scalable hash tables

+ suited for scalable hash tables.

+ init_state(Tab, State) -> NewState | abort(Reason) - Initiate the hash state for a new table + Initiates the hash state for a new table. Tab = atom() State = term() @@ -57,21 +58,21 @@ Reason = term() -

This function is invoked when a fragmented table is - created with mnesia:create_table/2 or when a - normal (un-fragmented) table is converted to be a +

Starts when a fragmented table is + created with the function mnesia:create_table/2 or + when a normal (unfragmented) table is converted to be a fragmented table with mnesia:change_table_frag/2.

-

Note that the add_frag/2 function will be invoked - one time each for the rest of the fragments (all but number 1) +

Notice that the function add_frag/2 is started + one time for each of the other fragments (except number 1) as a part of the table creation procedure.

-

State is the initial value of the hash_state frag_property. The NewState will be stored as - hash_state among the other frag_properties. -

+

State is the initial value of the hash_state + frag_property. NewState is stored as + hash_state among the other frag_properties.

add_frag(State) -> {NewState, IterFrags, AdditionalLockFrags} | abort(Reason) - This function is invoked when a new fragment is added to a fragmented table + Starts when a new fragment is added to a fragmented table. State = term() NewState = term() @@ -80,27 +81,26 @@ Reason = term() -

In order to scale well, it is a good idea ensure that the - records are evenly distributed over all fragments including +

To scale well, it is a good idea to ensure that the + records are evenly distributed over all fragments, including the new one.

-

The NewState will be stored as hash_state among the - other frag_properties. -

-

As a part of the add_frag procedure, Mnesia will iterate +

NewState is stored as hash_state among the + other frag_properties.

+

As a part of the add_frag procedure, Mnesia iterates over all fragments corresponding to the IterFrags numbers - and invoke key_to_frag_number(NewState,RecordKey) for + and starts key_to_frag_number(NewState,RecordKey) for each record. If the new fragment differs from the old - fragment, the record will be moved to the new fragment.

+ fragment, the record is moved to the new fragment.

As the add_frag procedure is a part of a schema - transaction Mnesia will acquire a write locks on the - affected tables. That is both the fragments corresponding + transaction, Mnesia acquires write locks on the + affected tables. That is, both the fragments corresponding to IterFrags and those corresponding to AdditionalLockFrags.

del_frag(State) -> {NewState, IterFrags, AdditionalLockFrags} | abort(Reason) - This function is invoked when a fragment is deleted from a fragmented table + Starts when a fragment is deleted from a fragmented table. State = term() NewState = term() @@ -109,39 +109,38 @@ Reason = term() -

The NewState will be stored as hash_state among the - other frag_properties. -

-

As a part of the del_frag procedure, Mnesia will iterate +

NewState is stored as hash_state among the + other frag_properties.

+

As a part of the del_frag procedure, Mnesia iterates over all fragments corresponding to the IterFrags numbers - and invoke key_to_frag_number(NewState,RecordKey) for + and starts key_to_frag_number(NewState,RecordKey) for each record. If the new fragment differs from the old - fragment, the record will be moved to the new fragment.

-

Note that all records in the last fragment must be moved to - another fragment as the entire fragment will be deleted.

+ fragment, the record is moved to the new fragment.

+

Notice that all records in the last fragment must be moved to + another fragment, as the entire fragment is deleted.

As the del_frag procedure is a part of a schema - transaction Mnesia will acquire a write locks on the - affected tables. That is both the fragments corresponding + transaction, Mnesia acquires write locks on the + affected tables. That is, both the fragments corresponding to IterFrags and those corresponding to AdditionalLockFrags.

key_to_frag_number(State, Key) -> FragNum | abort(Reason) - Resolves the key of a record into a fragment number + Resolves the key of a record into a fragment number. FragNum = integer()() Reason = term() -

This function is invoked whenever Mnesia needs to determine +

Starts whenever Mnesia needs to determine which fragment a certain record belongs to. It is typically - invoked at read, write and delete.

+ started at read, write, and delete.

match_spec_to_frag_numbers(State, MatchSpec) -> FragNums | abort(Reason) - Resolves a MatchSpec into a list of fragment numbers + Resolves a MatchSpec into a list of fragment numbers. MatcSpec = ets_select_match_spec() FragNums = [FragNum] @@ -149,17 +148,17 @@ Reason = term() -

This function is invoked whenever Mnesia needs to determine - which fragments that needs to be searched for a MatchSpec. - It is typically invoked at select and match_object.

+

This function is called whenever Mnesia needs to determine + which fragments that need to be searched for a MatchSpec. + It is typically called by select and + match_object.

See Also -

mnesia(3) -

+

mnesia(3)

-- cgit v1.2.3