• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

I_CacheDefs.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 
00025 
00026 #ifndef _I_CACHE_DEFS_H__
00027 #define _I_CACHE_DEFS_H__
00028 
00029 #define CACHE_INIT_FAILED           -1
00030 #define CACHE_INITIALIZING          0
00031 #define CACHE_INITIALIZED           1
00032 
00033 #define CACHE_ALT_INDEX_DEFAULT     -1
00034 #define CACHE_ALT_REMOVED           -2
00035 
00036 #define CACHE_DB_MAJOR_VERSION      24
00037 #define CACHE_DB_MINOR_VERSION      0
00038 
00039 #define CACHE_DIR_MAJOR_VERSION     18
00040 #define CACHE_DIR_MINOR_VERSION     0
00041 
00042 #define CACHE_DB_FDS                128
00043 
00044 // opcodes
00045 #define CACHE_OPEN_READ                 1
00046 #define CACHE_OPEN_READ_BUFFER          2
00047 #define CACHE_OPEN_READ_LONG            3
00048 #define CACHE_OPEN_READ_BUFFER_LONG     4
00049 #define CACHE_OPEN_WRITE                5
00050 #define CACHE_OPEN_WRITE_BUFFER         6
00051 #define CACHE_OPEN_WRITE_LONG           7
00052 #define CACHE_OPEN_WRITE_BUFFER_LONG    8
00053 #define CACHE_UPDATE                    9
00054 #define CACHE_REMOVE                    10
00055 #define CACHE_LINK                      11
00056 #define CACHE_DEREF                     12
00057 #define CACHE_LOOKUP_OP                 13
00058 
00059 enum CacheType {
00060   CACHE_NONE_TYPE = 0,  // for empty disk fragments
00061   CACHE_HTTP_TYPE = 1,
00062   CACHE_RTSP_TYPE = 2
00063 };
00064 
00065 // NOTE: All the failures are ODD, and one greater than the success
00066 //       Some of these must match those in <ts/ts.h>
00067 enum CacheEventType
00068 {
00069   CACHE_EVENT_LOOKUP = CACHE_EVENT_EVENTS_START + 0,
00070   CACHE_EVENT_LOOKUP_FAILED = CACHE_EVENT_EVENTS_START + 1,
00071   CACHE_EVENT_OPEN_READ = CACHE_EVENT_EVENTS_START + 2,
00072   CACHE_EVENT_OPEN_READ_FAILED = CACHE_EVENT_EVENTS_START + 3,
00073   // 4-7 unused
00074   CACHE_EVENT_OPEN_WRITE = CACHE_EVENT_EVENTS_START + 8,
00075   CACHE_EVENT_OPEN_WRITE_FAILED = CACHE_EVENT_EVENTS_START + 9,
00076   CACHE_EVENT_REMOVE = CACHE_EVENT_EVENTS_START + 12,
00077   CACHE_EVENT_REMOVE_FAILED = CACHE_EVENT_EVENTS_START + 13,
00078   CACHE_EVENT_UPDATE,
00079   CACHE_EVENT_UPDATE_FAILED,
00080   CACHE_EVENT_LINK,
00081   CACHE_EVENT_LINK_FAILED,
00082   CACHE_EVENT_DEREF,
00083   CACHE_EVENT_DEREF_FAILED,
00084   CACHE_EVENT_SCAN = CACHE_EVENT_EVENTS_START + 20,
00085   CACHE_EVENT_SCAN_FAILED = CACHE_EVENT_EVENTS_START + 21,
00086   CACHE_EVENT_SCAN_OBJECT = CACHE_EVENT_EVENTS_START + 22,
00087   CACHE_EVENT_SCAN_OPERATION_BLOCKED = CACHE_EVENT_EVENTS_START + 23,
00088   CACHE_EVENT_SCAN_OPERATION_FAILED = CACHE_EVENT_EVENTS_START + 24,
00089   CACHE_EVENT_SCAN_DONE = CACHE_EVENT_EVENTS_START + 25,
00090   //////////////////////////
00091   // Internal error codes //
00092   //////////////////////////
00093   CACHE_EVENT_RESPONSE = CACHE_EVENT_EVENTS_START + 50,
00094   CACHE_EVENT_RESPONSE_MSG,
00095   CACHE_EVENT_RESPONSE_RETRY
00096 };
00097 
00098 enum CacheScanResult
00099 {
00100   CACHE_SCAN_RESULT_CONTINUE = EVENT_CONT,
00101   CACHE_SCAN_RESULT_DONE = EVENT_DONE,
00102   CACHE_SCAN_RESULT_DELETE = 10,
00103   CACHE_SCAN_RESULT_DELETE_ALL_ALTERNATES,
00104   CACHE_SCAN_RESULT_UPDATE,
00105   CACHE_SCAN_RESULT_RETRY
00106 };
00107 
00108 enum CacheDataType
00109 {
00110   CACHE_DATA_HTTP_INFO = VCONNECTION_CACHE_DATA_BASE,
00111   CACHE_DATA_KEY,
00112   CACHE_DATA_RAM_CACHE_HIT_FLAG
00113 };
00114 
00115 enum CacheFragType
00116 {
00117   CACHE_FRAG_TYPE_NONE,
00118   CACHE_FRAG_TYPE_HTTP_V23, ///< DB version 23 or prior.
00119   CACHE_FRAG_TYPE_RTSP, ///< Should be removed once Cache Toolkit is implemented.
00120   CACHE_FRAG_TYPE_HTTP,
00121   NUM_CACHE_FRAG_TYPES
00122 };
00123 
00124 typedef CryptoHash CacheKey;
00125 #define CACHE_ALLOW_MULTIPLE_WRITES 1
00126 #define CACHE_EXPECTED_SIZE 32768
00127 
00128 /* uses of the CacheKey
00129    word(0) - cache partition segment
00130    word(1) - cache partition bucket
00131    word(2) - tag (lower bits), hosttable hash (upper bits)
00132    word(3) - ram cache hash, lookaside cache
00133  */
00134 #endif // __CACHE_DEFS_H__

Generated by  doxygen 1.7.1