more work
authorMichal Voců <michal@ruk.cuni.cz>
Thu, 7 Aug 2008 15:08:44 +0000 (15:08 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Thu, 7 Aug 2008 15:08:44 +0000 (15:08 +0000)
org.glite.lb.doc/src/LBDG-Introduction.tex
org.glite.lb.doc/src/LBDG.tex
org.glite.lb.doc/src/consumer_api.tex
org.glite.lb.doc/src/producer_api.tex

index 78fbef4..b47f67a 100644 (file)
@@ -196,17 +196,17 @@ described in respective API sections, the common parameters are:
 \lstinline'EDG_WLL_PARAM_X509_KEY' & 
 Key file to use for authentication. 
 \par {\it Type: } \lstinline'char *'
-\par {\it Env. variable: } \lstinline'X509_USER_KEY'  
+\par {\it Environment: } \lstinline'X509_USER_KEY'  
 \\
 \lstinline'EDG_WLL_PARAM_X509_CERT' &   
 Certificate file to use for authentication. 
 \par {\it Type: } \lstinline'char *'
-\par {\it Env. variable: } \lstinline'X509_USER_CERT'
+\par {\it Environment: } \lstinline'X509_USER_CERT'
 \\
 \lstinline'EDG_WLL_PARAM_CONNPOOL_SIZE' & 
 Maximum number of open connections maintained by the library. 
 \par {\it Type: } \lstinline'int'
-\\
+\par {\it Environment: } \\
 \end{tabularx}
 \caption{Common context parameters}
 \label{t:cparam}
@@ -297,11 +297,27 @@ can be found in the header file \verb'glite/wmsutils/cjobid.h'}
 \subsubsection{Event}
 \label{s:edg_wll_Event}
 The transparent data structure \verb'edg_wll_Event' represents \LB
-event, atomic data unit received and processed by \LB. It is a set of
-attributes (\ie key--value pairs) with predefined structure -- there
-are common attributes and each defined event type allows for specific
-set of additional attributes.  The most important common event
-attributes are listed in table~\ref{t:cevent}, 
+event, atomic data unit received and processed by \LB. It is a union of
+common structure and structures for all event types:
+\begin{lstlisting}
+union _edg_wll_Event {
+       edg_wll_EventCode       type;
+       edg_wll_AnyEvent        any;
+       edg_wll_TransferEvent   transfer;
+       edg_wll_AcceptedEvent   accepted;
+       //* \dots {\it more follows} \dots
+}
+typedef union _edg_wll_Event edg_wll_Event;
+\end{lstlisting}
+
+The most important common event attributes are listed in
+table~\ref{t:cevent}, the following example shows access:
+\begin{lstlisting}
+edg_wll_Event event;
+
+event.type = 0;
+event.any.user = "me";
+\end{lstlisting}
 
 \begin{table}[h]
 \begin{tabularx}{\textwidth}{llX}
@@ -360,11 +376,12 @@ a job as computed by the \LB from received events.  Much like the
 \verb'edg_wll_Event' structure it can be viewed as a set of
 attributes, where some attributes are common and some specific
 for a given job state (but unlike the \verb'edg_wll_Event' it is not
-implemented as union of structs but rather as one big struct). Most
-important common attributes are summarized in table~\ref{t:cstatus}.
+implemented as union of structs but rather as one big struct). 
+Generally speaking, when the attribute value is set, it is a valid
+part of job state description. Most important common attributes are
+summarized in table~\ref{t:cstatus}.
+
 
-\TODO{Is somewhere documented what attributes are filled in for given
-job type and status?}
 
 \begin{table}[h]
 \begin{tabularx}{\linewidth}{llX}
@@ -391,7 +408,7 @@ void edg_wll_FreeStatus(edg_wll_JobStat *);
 The following example prints out the states of jobs given in the input
 list; the job states are printed together with their subjobs on the
 same input list:
-\lstinputlisting[firstline=12,numbers=left]{util.c}
+\lstinputlisting[title={\bf File: }\lstname,firstline=12,numbers=left]{util.c}
 
 For more information see file \verb'include/glite/lb/jobstat.h'
 
index 0db8778..3b0f97a 100644 (file)
@@ -27,7 +27,7 @@
 \begin{document}
 \reversemarginpar
 \lstset{language=C,basicstyle=\footnotesize,numbers=none,breaklines=true}
-\lstset{title=\lstname}
+%\lstset{title={\bf File: }\lstname}
 \lstset{rangeprefix=/*,rangesuffix=*/,includerangemarker=false}
 \lstset{escapeinside={//*}{\^^M}}
 
index c824e35..befb913 100644 (file)
@@ -1,10 +1,26 @@
 % -*- mode: latex -*-
 
 \section{\LB\ Querying (Consumer) API}
+\label{s:ConsOview}
+The \LB Consumer API is used to obtain information from \LB server
+or Proxy using simple query language (see
+Sect.~\ref{s:querylang}). There are two general types of queries based
+on the results returned:
+\begin{itemize}
+\item query for events -- the result contains events satisfying given
+criteria,
+\item query for jobs -- the result contains JobId's and job states of jobs
+satisfying given criteria.
+\end{itemize}
 
-\label{ConsOview}
 
 \subsection{Query Language}
+\label{s:querylang}
+The \LB query language is based on simple value assertions on job and
+event attributes, which can be described using the following formula:
+$$
+E=mc^2
+$$
 
 \subsection{C Language Binding}
 
index 57345ce..6bb82de 100644 (file)
@@ -64,35 +64,44 @@ glite/lb/producer.h & Prototypes for all event logging functions. \\
 The table~\ref{t:pcontext} summarizes context parameters relevant to the
 event logging. If  parameter is not set in the context explicitly, the
 \LB\ library will search for value of corresponding environment
-variable. The symbolic C names should be prepended with
-\verb'EDG_WLL_PARAM_' prefix, \ie\ \verb'EDG_WLL_PARAM_HOST'.
+variable. 
 
 \begin{table}[h]
 \begin{tabularx}{\textwidth}{lX}
 {\bf Name} & {\bf Description} \\
 \hline
-\lstinline'HOST' & Hostname that appears as event origin. \par {\it
-Type: \lstinline'char*'} \par {\it Environment: } \\
-\lstinline'SOURCE'  & Event source component. \par {\it Type:
-\lstinline'edg_wll_Source'} \par {\it Environment: } \\
-\lstinline'DESTINATION'  &  Hostname of machine running
-locallogger/interlogger. \par {\it Type: \lstinline'char*'} \par {\it
-Environment: \lstinline'GLITE_WMS_LOG_DESTINATION'} \\ 
-\lstinline'DESTINATION_PORT' & Port the locallogger is listening
-on. \par {\it Type: \lstinline'int'} \par {\it Environment:
-\lstinline'GLITE_WMS_LOG_DESTINATION'} \\ 
-\lstinline'LOG_TIMEOUT'  & Logging timeout for asynchronous
-logging. \par {\it Type: \lstinline'struct timeval'} \par {\it
-Environment: \lstinline'GLITE_WMS_LOG_TIMEOUT'} \\ 
-\lstinline'LOG_SYNC_TIMEOUT'  & Logging timeout for synchronous
-logging. \par {\it Type: \lstinline'struct timeval'} \par {\it
-Environment: \lstinline'GLITE_WMS_LOG_SYNC_TIMEOUT'} \\
-\lstinline'LBPROXY_STORE_SOCK'  & \LB\ Proxy store socket
-path (if logging through \LB\ Proxy) \par {\it Type:
-\lstinline'char*'} \par {\it Environment: \lstinline'GLITE_WMS_LBPROXY_STORE_SOCK'} \\ 
-\lstinline'LBPROXY_USER' & Certificate subject of the user (if logging
-through \LB\ proxy). \par {\it Type: \lstinline'char*'} \par {\it
-Environment: \lstinline'GLITE_WMS_LBPROXY_USER'} \\
+\lstinline'EDG_WLL_PARAM_HOST' & 
+Hostname that appears as event origin. 
+\par {\it Type: } \lstinline'char*' 
+\par {\it Environment: } \\
+\lstinline'EDG_WLL_PARAM_SOURCE'  & 
+Event source component. 
+\par {\it Type: }\lstinline'edg_wll_Source'
+\par {\it Environment: } \\
+\lstinline'EDG_WLL_PARAM_DESTINATION'  &  
+Hostname of machine running locallogger/interlogger. 
+\par {\it Type: }\lstinline'char*' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LOG_DESTINATION' \\ 
+\lstinline'EDG_WLL_PARAM_DESTINATION_PORT' & 
+Port the locallogger is listening on. 
+\par {\it Type: } \lstinline'int' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LOG_DESTINATION' \\ 
+\lstinline'EDG_WLL_LOG_TIMEOUT'  & 
+Logging timeout for asynchronous logging. 
+\par {\it Type: }\lstinline'struct timeval' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LOG_TIMEOUT' \\ 
+\lstinline'EDG_WLL_LOG_SYNC_TIMEOUT'  & 
+Logging timeout for synchronous logging. 
+\par {\it Type: }\lstinline'struct timeval' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LOG_SYNC_TIMEOUT' \\
+\lstinline'EDG_WLL_LBPROXY_STORE_SOCK'  & 
+\LB\ Proxy store socket path (if logging through \LB\ Proxy) 
+\par {\it Type: }\lstinline'char*' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LBPROXY_STORE_SOCK' \\ 
+\lstinline'EDG_WLL_LBPROXY_USER' & 
+Certificate subject of the user (if logging through \LB\ proxy). 
+\par {\it Type: }\lstinline'char*' 
+\par {\it Environment: }\lstinline'GLITE_WMS_LBPROXY_USER' \\
 \end{tabularx}
 \caption{Producer specific context parameters}
 \label{t:pcontext}
@@ -117,16 +126,16 @@ In this section we will give commented example how to log an UserTag event to
 the \LB.
 
 First we have to include neccessary headers:
-\lstinputlisting[numbers=left,linerange=headers-end\ headers]{prod_example1.c}
+\lstinputlisting[title={\bf File: }\lstname,numbers=left,linerange=headers-end\ headers]{prod_example1.c}
 
 Initialize context and set parameters:
-\lstinputlisting[numbers=left,linerange=context-end\ context]{prod_example1.c}
+\lstinputlisting[title={\bf File: }\lstname,numbers=left,linerange=context-end\ context]{prod_example1.c}
 
 \TODO{proper setting of sequence codes}
-\lstinputlisting[numbers=left,linerange=sequence-end\ sequence]{prod_example1.c}
+\lstinputlisting[title={\bf File: }\lstname,numbers=left,linerange=sequence-end\ sequence]{prod_example1.c}
 
 Log the event:
-\lstinputlisting[numbers=left,linerange=log-end\ log]{prod_example1.c}
+\lstinputlisting[title={\bf File: }\lstname,numbers=left,linerange=log-end\ log]{prod_example1.c}
 
 The \verb'edg_wll_LogEvent()' function is defined as follows:
 \begin{lstlisting}[numbers=none]