ExecStreamDefs.h

Go to the documentation of this file.
00001 /*
00002 // $Id: //open/dev/fennel/exec/ExecStreamDefs.h#14 $
00003 // Fennel is a library of data storage and processing components.
00004 // Copyright (C) 2005-2009 The Eigenbase Project
00005 // Copyright (C) 2005-2009 SQLstream, Inc.
00006 // Copyright (C) 2005-2009 LucidEra, Inc.
00007 // Portions Copyright (C) 2004-2009 John V. Sichi
00008 //
00009 // This program is free software; you can redistribute it and/or modify it
00010 // under the terms of the GNU General Public License as published by the Free
00011 // Software Foundation; either version 2 of the License, or (at your option)
00012 // any later version approved by The Eigenbase Project.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 #ifndef Fennel_ExecStreamDefs_Included
00025 #define Fennel_ExecStreamDefs_Included
00026 
00027 #include "fennel/tuple/TupleDescriptor.h"
00028 #include "fennel/segment/SegmentAccessor.h"
00029 
00030 FENNEL_BEGIN_NAMESPACE
00031 
00036 typedef uint ExecStreamId;
00037 
00038 enum ExecStreamBufState
00039 {
00040     EXECBUF_EMPTY,
00041     EXECBUF_NONEMPTY,
00042     EXECBUF_UNDERFLOW,
00043     EXECBUF_OVERFLOW,
00044     EXECBUF_EOS
00045 };
00046 
00047 static std::string ExecStreamBufState_names[] = {
00048     "EXECBUF_EMPTY",
00049     "EXECBUF_NONEMPTY",
00050     "EXECBUF_UNDERFLOW",
00051     "EXECBUF_OVERFLOW",
00052     "EXECBUF_EOS"
00053 };
00054 
00055 static std::string ExecStreamBufState_names_short[] = {
00056     "EMP",
00057     "NEM",
00058     "UND",
00059     "OVR",
00060     "EOS"
00061 };
00062 
00063 inline std::ostream & operator<< (std::ostream &os, ExecStreamBufState e)
00064 {
00065     return os << ExecStreamBufState_names[e];
00066 }
00067 
00068 enum ExecStreamBufProvision
00069 {
00070     BUFPROV_NONE,
00071     BUFPROV_CONSUMER,
00072     BUFPROV_PRODUCER,
00073 };
00074 
00075 enum ExecStreamResult
00076 {
00077     EXECRC_BUF_UNDERFLOW,
00078     EXECRC_BUF_OVERFLOW,
00079     EXECRC_EOS,
00080     EXECRC_QUANTUM_EXPIRED,
00081     EXECRC_YIELD
00082 };
00083 
00084 static std::string ExecStreamResult_names[] = {
00085     "EXECRC_BUF_UNDERFLOW",
00086     "EXECRC_BUF_OVERFLOW",
00087     "EXECRC_EOS",
00088     "EXECRC_QUANTUM_EXPIRED",
00089     "EXECRC_YIELD"
00090 };
00091 
00092 static std::string ExecStreamResult_names_short[] = {
00093     "UND",
00094     "OVR",
00095     "EOS",
00096     "QNT",
00097     "YLD"
00098 };
00099 
00100 inline std::ostream & operator<< (std::ostream &os, ExecStreamResult e)
00101 {
00102     return os << ExecStreamResult_names[e];
00103 }
00104 
00111 struct FENNEL_EXEC_EXPORT ExecStreamQuantum
00112 {
00116     uint nTuplesMax;
00117 
00121     explicit ExecStreamQuantum()
00122     {
00123         nTuplesMax = MAXU;
00124     }
00125 };
00126 
00131 enum ExecStreamResourceSettingType {
00135     EXEC_RESOURCE_ACCURATE,
00141     EXEC_RESOURCE_ESTIMATE,
00145     EXEC_RESOURCE_UNBOUNDED
00146 };
00147 
00152 struct FENNEL_EXEC_EXPORT ExecStreamResourceQuantity
00153 {
00159     uint nThreads;
00160 
00165     uint nCachePages;
00166 
00167     explicit ExecStreamResourceQuantity()
00168     {
00169         nThreads = 0;
00170         nCachePages = 0;
00171     }
00172 };
00173 
00177 struct FENNEL_EXEC_EXPORT ExecStreamParams
00178 {
00183     SharedCacheAccessor pCacheAccessor;
00184 
00189     SegmentAccessor scratchAccessor;
00190 
00191     explicit ExecStreamParams();
00192 
00193     virtual ~ExecStreamParams();
00194 };
00195 
00196 FENNEL_END_NAMESPACE
00197 
00198 #endif
00199 
00200 // End ExecStreamDefs.h

Generated on Mon Jun 22 04:00:18 2009 for Fennel by  doxygen 1.5.1