00001 /* 00002 * Copyright (C) 2009, Edmundo Albuquerque de Souza e Silva. 00003 * 00004 * This file may be distributed under the terms of the Q Public License 00005 * as defined by Trolltech AS of Norway and appearing in the file 00006 * LICENSE.QPL included in the packaging of this file. 00007 * 00008 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 00009 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00010 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00012 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00013 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00014 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 * 00016 * Thanks: Jose Renato Santos 00017 * 00018 */ 00019 00020 /////////////////////////////////////////////////////////////////////////////// 00021 // ServerTypes.h: Data types used in several components of RIO Server 00022 /////////////////////////////////////////////////////////////////////////////// 00023 00024 #ifndef __SERVERTYPES_H_ 00025 #define __SERVERTYPES_H_ 00026 00027 #include "RioInterfaceTypes.h" 00028 #include "RioTypes.h" 00029 #include <sys/time.h> 00030 00031 // forward declarations 00032 class RioStreamObj; 00033 class RioObject; 00034 00035 // Physical disk block location 00036 struct RioDiskBlock 00037 { 00038 short disk; 00039 unsigned int block; 00040 }; 00041 00042 // Maximum Number of replications 00043 static const int MaxReplications = 8; 00044 00045 // Type of data request operation 00046 typedef enum 00047 { 00048 RealTimeRead = 1, 00049 NonRealTimeRead = 2, 00050 NonRealTimeWrite = 3, 00051 // added to be used to manage buffers -------------------------- 00052 RealTimePrefetchBlock = 4, 00053 RealTimeCancelBlock = 5, 00054 RealTimeSendBlock = 6 00055 // ------------------------------------------------------------------------ 00056 } DataRequestOperation; 00057 00058 // Logical Data Request 00059 struct DataRequest 00060 { 00061 CommunicationAddress Target; // Client ip address 00062 int Reqid; 00063 DataRequestOperation Operation; 00064 RioStreamObj *streamobj; 00065 RioObject *rioobject; 00066 int BufferId; 00067 RioResult Status; 00068 int Block; 00069 int RepBits; 00070 int RepNum; 00071 RioDiskBlock Reps[MaxReplications]; 00072 int RequestCounter; 00073 // added to get estimated queue time --------------------------- 00074 struct timeval ArrivalTime; 00075 int QueueSize; 00076 // ------------------------------------------------------------------------ 00077 // Novo campo usado pela implementacao de reinicio dos servidores, usado 00078 // para informar que a requisicao foi cancelada e que a funcao 00079 // RequestCompleted nao deve mais ser chamada. 00080 bool RequestCancelled; 00081 }; 00082 00083 #endif //__SERVERTYPES_H_