Re: Application_API: MAX-LEVEL

Jean-Louis Martineau <[email protected]> Mon, 11 Sep 2017 14:03:14 -0400
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
On 11/09/17 11:37 AM, Chapman Flack wrote:
> What should an application report for the 'support' MAX-LEVEL item?
The support subcommand is not called with host and disk argument.
It must report the maximum level the application support, in your case 99.
There is a hard limit of 399.

>
> Should it be some fixed, theoretical value ("I always support 99
> levels in theory")?
>
> Or should it be the current, accurate value ("My local state has
> prior levels 0 to 3, so my MAX-LEVEL at the moment is 4")?
>
> Abstract.pm 
> <http://Abstract.pm> 
> is designed so reporting the current value is possible,
> but I notice my applications are currently reporting a fixed value
> (I think in the first instance because I was in a hurry and not sure
> which was correct, and the later ones because I copied that code).
>
> Also, what should an application do when 'estimate' is asked for
> a higher level than currently possible? I believe all my apps
> currently return -1 -1 for the level and also print_to_server
> with Amanda::App_Script::ERROR. They are working that way: the
> planner picks one of the levels that did not report -1 -1, and it
> does not choke on the error.
>
> Does that mean reporting -1 -1 should be sufficient, and I do not
> need to log the error?

-1 -1 means the application can't compute the estimate, so an estimate 
server can be used.
The Amanda::App_Script::ERROR should be used only when all estimate fail.
There is no way do what you want.
I committed a patch to allow it , the application must output "-2 -2"

>
> Or, does it mean MAX-LEVEL should report the current allowed maximum,
> and then higher levels will not be requested, and I should leave the
> error in place because it Should Never Happen?
>
> -Chap
This message is the property of CARBONITE, INC. and may contain confidential or privileged information.
If this message has been delivered to you by mistake, then do not copy or deliver this message to anyone.  Instead, destroy it and notify me by reply e-mail