|
@@ -227,7 +227,8 @@ default_validation_class='UTF8Type' and key_validation_class='UTF8Type';
|
|
|
</itemizedlist>
|
|
|
</para>
|
|
|
<para>
|
|
|
- Bellow you can see the schema for the <emphasis>location</emphasis> table:
|
|
|
+ Bellow you can see the schema for the <emphasis>location</emphasis>
|
|
|
+ table (when use_domain not set):
|
|
|
</para>
|
|
|
<para>
|
|
|
</para>
|
|
@@ -241,12 +242,29 @@ default_validation_class='UTF8Type' and key_validation_class='UTF8Type';
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
|
|
- Observe first that the <emphasis>row key is the username</emphasis> and the <emphasis>secondary index is the contact</emphasis>.
|
|
|
+ Observe first that the <emphasis>row key is the username</emphasis> and
|
|
|
+ the <emphasis>secondary index is the contact</emphasis>.
|
|
|
We have also defined a timestamp column - <emphasis>expires</emphasis>.
|
|
|
- In this example, both the row key and the secondary index are defined by only one column,
|
|
|
- but they can be formed out of more columns. You can list them separated by space.
|
|
|
</para>
|
|
|
|
|
|
+ <para>
|
|
|
+ If you need to use the domain part of the AOR also (you have set use_domain
|
|
|
+ parameter for usrloc in the script), you should include the domain column in
|
|
|
+ the list of columns and in the primary key. The schema will then look like this:
|
|
|
+ </para>
|
|
|
+
|
|
|
+<programlisting format="linespecific">
|
|
|
+ ...
|
|
|
+ callid(string) cflags(int) contact(string) cseq(int) domain(string) <emphasis>expires(timestamp)</emphasis> flags(int) last_modified(int) methods(int) path(string) q(double) received(string) socket(string) user_agent(string) username(string) ruid(string) instance(string) reg_id(int)
|
|
|
+ <emphasis>username domain</emphasis>
|
|
|
+ <emphasis>contact</emphasis>
|
|
|
+ ...
|
|
|
+</programlisting>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ Notice that a key (primary or secondary) can be composed from more columns,
|
|
|
+ in which case you have to specify them separated by space.
|
|
|
+ </para>
|
|
|
<para>
|
|
|
To understand why the schema looks like this, we must first see which
|
|
|
queries are performed on the location table.
|
|
@@ -281,11 +299,11 @@ default_validation_class='UTF8Type' and key_validation_class='UTF8Type';
|
|
|
</listitem>
|
|
|
</itemizedlist>
|
|
|
<para>
|
|
|
- The timestamp column that leaves the Cassandra cluster to deal with deleting expired
|
|
|
- record can be used only with a modification to the usrloc module that replaces the
|
|
|
- update performed at re-registration with an insert operation (so that all columns
|
|
|
- are updated).
|
|
|
- This behavior can be enabled by setting a parameter in the usrloc module
|
|
|
+ The timestamp column that leaves the Cassandra cluster to deal with deleting the expired
|
|
|
+ records. For this to work right we needed to modify a bit the behavior of usrloc module and
|
|
|
+ replace update sql query performed at re-registration with an insert sql query (so that all
|
|
|
+ columns are updated and the new timestamp is set for all columns).
|
|
|
+ This behavior is enabled by setting a parameter in the usrloc module
|
|
|
<emphasis>db_update_as_insert</emphasis>:
|
|
|
</para>
|
|
|
<para>
|
|
@@ -297,6 +315,21 @@ default_validation_class='UTF8Type' and key_validation_class='UTF8Type';
|
|
|
...
|
|
|
</programlisting>
|
|
|
|
|
|
+ <para>
|
|
|
+ Also you should disable in usrloc module the timer routine that checks for expired records.
|
|
|
+ You can do this by setting the timer interval to 0.
|
|
|
+ <emphasis>timer_interval</emphasis>:
|
|
|
+ </para>
|
|
|
+ <para>
|
|
|
+ </para>
|
|
|
+
|
|
|
+<programlisting format="linespecific">
|
|
|
+ ...
|
|
|
+ modparam("usrloc", "timer_interval", 0)
|
|
|
+ ...
|
|
|
+</programlisting>
|
|
|
+
|
|
|
+
|
|
|
<para>
|
|
|
The alternative would have been to define an index on the expire column and
|
|
|
run a external job to periodically delete the expired records. However,
|