[ale] Organizing data

Chris Fowler cfowler at outpostsentinel.com
Wed Apr 28 09:04:28 EDT 2004


My question based on the hashes of hashes is it the best way to organize
my data.  I can walk these trees it just seems difficult to do so and
not so clear to the programmer behind me.

Is this method the fastest way to store the data in mem so I can walk
it.

I have to walk these alarms and determine if I've sent an email to that 
escalation_group or not.  If I have not then I need to send it.  If I
have I need to verify the timeout (15 minutes) has not occured.  If it
has I need to "escalate" the issue and got to the send escalation_group 
that is associated with the notification_group that is associated with a
location that is associated with and alarm.

I will keep track of what I have done in a table.

+---------------+------------------+------+-----+---------------------+-------+
| Field         | Type             | Null | Key | Default             |
Extra |
+---------------+------------------+------+-----+---------------------+-------+
| alarm_id      | int(11)          |      | PRI | 0                  
|       |
| escalation_id | int(10) unsigned |      | PRI | 0                  
|       |
| success       | enum('Y','N')    |      |     | N                  
|       |
| sent          | datetime         |      |     | 0000-00-00 00:00:00
|       |
+---------------+------------------+------+-----+---------------------+-------+

On Wed, 2004-04-28 at 08:51, Jason Etheridge wrote:
> Chris Fowler wrote:
> > When I get into the hash of hashes I have to know if a key points to a
> > value or another hash.
> 
> if ( ($a_ref->($ref}->{$ref2}->{$ref3}) =~ /^HASH(.+)$/ ) {
> 
> 	// it's probably a hash reference unless stuff
> 	// like "HASH(0x10d870)" could be valid data
> 
> } else {
> 
> 	// it's not a hash
> 
> }
> 
> > So I want to mimic the data I just want to do it right.
> 
> There's the kicker.  How do you define that? :D
> 
> -- Jason



More information about the Ale mailing list