Re: [cciug] evil twin problem revisited

From: Paul D. Smith (pausmith@nortelnetworks.com)
Date: Fri Jul 13 2001 - 13:32:24 EDT


%% Don Skanes <DSkanes@vpacket.com> writes:

  ds> I have a trigger enforced on mkelem at this point which disallows
  ds> this but it is rather inefficient since it checks all directory
  ds> versions of the parent of the new element for each new mkelem. I
  ds> was wondering if anyone has found a better solution to this also.

The algorithm I use is to just check the LATEST on each branch of the
parent directory. This saves a lot of time, at the expense of a bit of
accuracy. Your risk-aversion threshold may vary.

Also, you don't say how you're doing the checking, but the fastest way
is to use "lsvtree -short -all -obsolete" (or some combination, as you
see fit) on the parent directory to get the version tree, then use
version-extended naming to see if the element exists there (assuming you
are using dynamic views).

And of course, you should have a way to disable the trigger (setting an
environment variable or something) for when you're importing large
amounts of new elements.

In reality, creating new elements is not all that common an operation
that it needs to be super-fast. Occasionally you'll need to import a
bunch of new files, but usually it's just one file here or there.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@baynetworks.com>    HASMAT--HA Software Methods & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 22:03:55 EDT