Made the default page size a compile flag
This commit is contained in:
		
							parent
							
								
									f26ec4c6d8
								
							
						
					
					
						commit
						12e04b45af
					
				
					 3 changed files with 12 additions and 4 deletions
				
			
		| 
						 | 
					@ -79,6 +79,9 @@ endif()
 | 
				
			||||||
if (DEFINED BIGMETA )
 | 
					if (DEFINED BIGMETA )
 | 
				
			||||||
  add_definitions(-DBIGMETA=1)
 | 
					  add_definitions(-DBIGMETA=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					if (DEFINED DATASIZE )
 | 
				
			||||||
 | 
					  add_definitions(-DSHM_DATASIZE=${DATASIZE})
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
if (NOT DEFINED NOUPDATE )
 | 
					if (NOT DEFINED NOUPDATE )
 | 
				
			||||||
  add_definitions(-DUPDATER=1)
 | 
					  add_definitions(-DUPDATER=1)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,11 +57,16 @@ static const char * DBG_LVL_LIST[] = {"NONE", "FAIL", "ERROR", "WARN", "INFO", "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef SHM_DATASIZE
 | 
				
			||||||
 | 
					#define SHM_DATASIZE 25
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// The size used for stream header pages under Windows, where they cannot be size-detected.
 | 
					/// The size used for stream header pages under Windows, where they cannot be size-detected.
 | 
				
			||||||
#define DEFAULT_META_PAGE_SIZE 16 * 1024 * 1024
 | 
					#define DEFAULT_META_PAGE_SIZE 16 * 1024 * 1024
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// The size used for stream data pages under Windows, where they cannot be size-detected.
 | 
					/// The size used for stream data pages under Windows, where they cannot be size-detected.
 | 
				
			||||||
#define DEFAULT_DATA_PAGE_SIZE 25 * 1024 * 1024
 | 
					#define DEFAULT_DATA_PAGE_SIZE SHM_DATASIZE * 1024 * 1024
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// The size used for server configuration pages.
 | 
					/// The size used for server configuration pages.
 | 
				
			||||||
#define DEFAULT_CONF_PAGE_SIZE 4 * 1024 * 1024
 | 
					#define DEFAULT_CONF_PAGE_SIZE 4 * 1024 * 1024
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -490,17 +490,17 @@ namespace Mist {
 | 
				
			||||||
      //If there is no page, create it
 | 
					      //If there is no page, create it
 | 
				
			||||||
      if (!pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) {
 | 
					      if (!pagesByTrack.count(tid) || pagesByTrack[tid].size() == 0) {
 | 
				
			||||||
        nextPageNum = 1;
 | 
					        nextPageNum = 1;
 | 
				
			||||||
        pagesByTrack[tid][1].dataSize = (25 * 1024 * 1024);//Initialize op 25mb
 | 
					        pagesByTrack[tid][1].dataSize = DEFAULT_DATA_PAGE_SIZE;//Initialize op 25mb
 | 
				
			||||||
        pagesByTrack[tid][1].pageNum = 1;
 | 
					        pagesByTrack[tid][1].pageNum = 1;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      //Take the last allocated page
 | 
					      //Take the last allocated page
 | 
				
			||||||
      std::map<unsigned long, DTSCPageData>::reverse_iterator tmpIt = pagesByTrack[tid].rbegin();
 | 
					      std::map<unsigned long, DTSCPageData>::reverse_iterator tmpIt = pagesByTrack[tid].rbegin();
 | 
				
			||||||
      //Compare on 8 mb boundary
 | 
					      //Compare on 8 mb boundary
 | 
				
			||||||
      if (tmpIt->second.curOffset > (8 * 1024 * 1024)) { 
 | 
					      if (tmpIt->second.curOffset > FLIP_DATA_PAGE_SIZE) { 
 | 
				
			||||||
        //Create the book keeping data for the new page
 | 
					        //Create the book keeping data for the new page
 | 
				
			||||||
        nextPageNum = tmpIt->second.pageNum + tmpIt->second.keyNum;
 | 
					        nextPageNum = tmpIt->second.pageNum + tmpIt->second.keyNum;
 | 
				
			||||||
        INFO_MSG("We should go to next page now, transition from %lu to %d", tmpIt->second.pageNum, nextPageNum);
 | 
					        INFO_MSG("We should go to next page now, transition from %lu to %d", tmpIt->second.pageNum, nextPageNum);
 | 
				
			||||||
        pagesByTrack[tid][nextPageNum].dataSize = (25 * 1024 * 1024);
 | 
					        pagesByTrack[tid][nextPageNum].dataSize = DEFAULT_DATA_PAGE_SIZE;
 | 
				
			||||||
        pagesByTrack[tid][nextPageNum].pageNum = nextPageNum;
 | 
					        pagesByTrack[tid][nextPageNum].pageNum = nextPageNum;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      pagesByTrack[tid].rbegin()->second.lastKeyTime = packet.getTime();
 | 
					      pagesByTrack[tid].rbegin()->second.lastKeyTime = packet.getTime();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue