diff --git a/configure.ac b/configure.ac index b13a56b3..b974cbf6 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_PREREQ(2.52) AC_INIT([scribe], [1.5.0]) AC_CONFIG_MACRO_DIR([aclocal]) -AM_INIT_AUTOMAKE([foreign -Wall]) +#AM_INIT_AUTOMAKE([foreign -Wall]) # To install locally FB_INITIALIZE([localinstall]) AC_PREFIX_DEFAULT([/usr/local]) diff --git a/src/conf.cpp b/src/conf.cpp index 43b66087..d457ff9d 100644 --- a/src/conf.cpp +++ b/src/conf.cpp @@ -27,7 +27,7 @@ using namespace boost; using namespace std; -extern shared_ptr g_Handler; +extern boost::shared_ptr g_Handler; StoreConf::StoreConf() { } diff --git a/src/conn_pool.cpp b/src/conn_pool.cpp index 5b19eae4..3ebb496a 100644 --- a/src/conn_pool.cpp +++ b/src/conn_pool.cpp @@ -56,12 +56,12 @@ string ConnPool::makeKey(const string& hostname, unsigned long port) { bool ConnPool::open(const string& hostname, unsigned long port, int timeout) { return openCommon(makeKey(hostname, port), - shared_ptr(new scribeConn(hostname, port, timeout))); + boost::shared_ptr(new scribeConn(hostname, port, timeout))); } bool ConnPool::open(const string &service, const server_vector_t &servers, int timeout) { return openCommon(service, - shared_ptr(new scribeConn(service, servers, timeout))); + boost::shared_ptr(new scribeConn(service, servers, timeout))); } void ConnPool::close(const string& hostname, unsigned long port) { @@ -73,16 +73,16 @@ void ConnPool::close(const string &service) { } int ConnPool::send(const string& hostname, unsigned long port, - shared_ptr messages) { + boost::shared_ptr messages) { return sendCommon(makeKey(hostname, port), messages); } int ConnPool::send(const string &service, - shared_ptr messages) { + boost::shared_ptr messages) { return sendCommon(service, messages); } -bool ConnPool::openCommon(const string &key, shared_ptr conn) { +bool ConnPool::openCommon(const string &key, boost::shared_ptr conn) { #define RETURN(x) {pthread_mutex_unlock(&mapMutex); return(x);} @@ -96,7 +96,7 @@ bool ConnPool::openCommon(const string &key, shared_ptr conn) { pthread_mutex_lock(&mapMutex); conn_map_t::iterator iter = connMap.find(key); if (iter != connMap.end()) { - shared_ptr old_conn = (*iter).second; + boost::shared_ptr old_conn = (*iter).second; if (old_conn->isOpen()) { old_conn->addRef(); RETURN(true); @@ -105,7 +105,7 @@ bool ConnPool::openCommon(const string &key, shared_ptr conn) { LOG_OPER("CONN_POOL: switching to a new connection <%s>", key.c_str()); conn->setRef(old_conn->getRef()); conn->addRef(); - // old connection will be magically deleted by shared_ptr + // old connection will be magically deleted by boost::shared_ptr connMap[key] = conn; RETURN(true); } @@ -142,7 +142,7 @@ void ConnPool::closeCommon(const string &key) { } int ConnPool::sendCommon(const string &key, - shared_ptr messages) { + boost::shared_ptr messages) { pthread_mutex_lock(&mapMutex); conn_map_t::iterator iter = connMap.find(key); if (iter != connMap.end()) { @@ -212,8 +212,8 @@ bool scribeConn::open() { try { socket = serviceBased ? - shared_ptr(new TSocketPool(serverList)) : - shared_ptr(new TSocket(remoteHost, remotePort)); + boost::shared_ptr(new TSocketPool(serverList)) : + boost::shared_ptr(new TSocket(remoteHost, remotePort)); if (!socket) { throw std::runtime_error("Failed to create socket"); @@ -234,16 +234,16 @@ bool scribeConn::open() { */ socket->setLinger(0, 0); - framedTransport = shared_ptr(new TFramedTransport(socket)); + framedTransport = boost::shared_ptr(new TFramedTransport(socket)); if (!framedTransport) { throw std::runtime_error("Failed to create framed transport"); } - protocol = shared_ptr(new TBinaryProtocol(framedTransport)); + protocol = boost::shared_ptr(new TBinaryProtocol(framedTransport)); if (!protocol) { throw std::runtime_error("Failed to create protocol"); } protocol->setStrict(false, false); - resendClient = shared_ptr(new scribeClient(protocol)); + resendClient = boost::shared_ptr(new scribeClient(protocol)); if (!resendClient) { throw std::runtime_error("Failed to create network client"); } diff --git a/src/dynamic_bucket_updater.cpp b/src/dynamic_bucket_updater.cpp index 482bcaaf..393b352d 100644 --- a/src/dynamic_bucket_updater.cpp +++ b/src/dynamic_bucket_updater.cpp @@ -11,7 +11,7 @@ using namespace facebook; using namespace facebook::fb303; using namespace scribe::thrift; using boost::shared_ptr; -extern shared_ptr g_Handler; +extern boost::shared_ptr g_Handler; DynamicBucketUpdater* DynamicBucketUpdater::instance_ = NULL; Mutex DynamicBucketUpdater::instanceLock_; @@ -341,7 +341,7 @@ bool DynamicBucketUpdater::updateInternal( catMap_.erase(catIter); } - shared_ptr socket = shared_ptr( + boost::shared_ptr socket = boost::shared_ptr( new TSocket(remoteHost, remotePort)); if (!socket) { @@ -362,10 +362,10 @@ bool DynamicBucketUpdater::updateInternal( socket->setRecvTimeout(recvTimeout); socket->setSendTimeout(sendTimeout); - shared_ptr framedTransport = shared_ptr( + boost::shared_ptr framedTransport = boost::shared_ptr( new TFramedTransport(socket)); framedTransport->open(); - shared_ptr protocol = shared_ptr( + boost::shared_ptr protocol = boost::shared_ptr( new TBinaryProtocol(framedTransport)); // no strict version checking diff --git a/src/file.cpp b/src/file.cpp index f9f80208..fb86386f 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -34,17 +34,17 @@ boost::shared_ptr FileInterface::createFileInterface(const std::s const std::string& name, bool framed) { if (0 == type.compare("std")) { - return shared_ptr(new StdFile(name, framed)); + return boost::shared_ptr(new StdFile(name, framed)); } else if (0 == type.compare("hdfs")) { - return shared_ptr(new HdfsFile(name)); + return boost::shared_ptr(new HdfsFile(name)); } else { - return shared_ptr(); + return boost::shared_ptr(); } } std::vector FileInterface::list(const std::string& path, const std::string &fsType) { std::vector files; - shared_ptr concrete_file = createFileInterface(fsType, path); + boost::shared_ptr concrete_file = createFileInterface(fsType, path); if (concrete_file) { concrete_file->listImpl(path, files); } diff --git a/src/scribe_server.cpp b/src/scribe_server.cpp index 0641af2b..01919fe7 100644 --- a/src/scribe_server.cpp +++ b/src/scribe_server.cpp @@ -34,7 +34,7 @@ using namespace std; using boost::shared_ptr; -shared_ptr g_Handler; +boost::shared_ptr g_Handler; #define DEFAULT_CHECK_PERIOD 5 #define DEFAULT_MAX_MSG_PER_SECOND 0 @@ -109,7 +109,7 @@ int main(int argc, char **argv) { // seed random number generation with something reasonably unique srand(time(NULL) ^ getpid()); - g_Handler = shared_ptr(new scribeHandler(port, config_file)); + g_Handler = boost::shared_ptr(new scribeHandler(port, config_file)); g_Handler->initialize(); scribe::startServer(); // never returns @@ -242,10 +242,10 @@ bool scribeHandler::createCategoryFromModel( return false; } - shared_ptr pstore; + boost::shared_ptr pstore; if (newThreadPerCategory) { // Create a new thread/StoreQueue for this category - pstore = shared_ptr(new StoreQueue(model, category)); + pstore = boost::shared_ptr(new StoreQueue(model, category)); LOG_OPER("[%s] Creating new category store from model %s", category.c_str(), model->getCategoryHandled().c_str()); @@ -258,10 +258,10 @@ bool scribeHandler::createCategoryFromModel( category.c_str(), model->getCategoryHandled().c_str()); } - shared_ptr pstores; + boost::shared_ptr pstores; category_map_t::iterator cat_iter = categories.find(category); if (cat_iter == categories.end()) { - pstores = shared_ptr(new store_list_t); + pstores = boost::shared_ptr(new store_list_t); categories[category] = pstores; } else { pstores = cat_iter->second; @@ -292,7 +292,7 @@ bool scribeHandler::throttleRequest(const vector& messages) { for (category_map_t::iterator cat_iter = categories.begin(); cat_iter != categories.end(); ++cat_iter) { - shared_ptr pstores = cat_iter->second; + boost::shared_ptr pstores = cat_iter->second; if (!pstores) { throw std::logic_error("throttle check: iterator in category map holds null pointer"); } @@ -315,10 +315,10 @@ bool scribeHandler::throttleRequest(const vector& messages) { } // Should be called while holding a writeLock on scribeHandlerLock -shared_ptr scribeHandler::createNewCategory( +boost::shared_ptr scribeHandler::createNewCategory( const string& category) { - shared_ptr store_list; + boost::shared_ptr store_list; // First, check the list of category prefixes for a model category_map_t::iterator cat_prefix_iter = category_prefixes.begin(); @@ -327,7 +327,7 @@ shared_ptr scribeHandler::createNewCategory( if (cat_prefix_iter->first.compare(0, len-1, category, 0, len-1) == 0) { // Found a matching prefix model - shared_ptr pstores = cat_prefix_iter->second; + boost::shared_ptr pstores = cat_prefix_iter->second; for (store_list_t::iterator store_iter = pstores->begin(); store_iter != pstores->end(); ++store_iter) { createCategoryFromModel(category, *store_iter); @@ -368,7 +368,7 @@ shared_ptr scribeHandler::createNewCategory( // Add this message to every store in list void scribeHandler::addMessage( const LogEntry& entry, - const shared_ptr& store_list) { + const boost::shared_ptr& store_list) { int numstores = 0; @@ -416,7 +416,7 @@ ResultCode scribeHandler::Log(const vector& messages) { continue; } - shared_ptr store_list; + boost::shared_ptr store_list; string category = (*msg_iter).category; category_map_t::iterator cat_iter; @@ -496,7 +496,7 @@ bool scribeHandler::throttleDeny(int num_messages) { void scribeHandler::stopStores() { setStatus(STOPPING); - shared_ptr store_list; + boost::shared_ptr store_list; for (store_list_t::iterator store_iter = defaultStores.begin(); store_iter != defaultStores.end(); ++store_iter) { if (!(*store_iter)->isModelStore()) { @@ -652,9 +652,9 @@ void scribeHandler::initialize() { // Configures the store specified by the store configuration. Returns false if failed. bool scribeHandler::configureStore(pStoreConf store_conf, int *numstores) { string category; - shared_ptr pstore; + boost::shared_ptr pstore; vector category_list; - shared_ptr model; + boost::shared_ptr model; bool single_category = true; @@ -685,7 +685,7 @@ bool scribeHandler::configureStore(pStoreConf store_conf, int *numstores) { } else if (single_category) { // configure single store - shared_ptr result = + boost::shared_ptr result = configureStoreCategory(store_conf, category_list[0], model); if (result == NULL) { @@ -718,7 +718,7 @@ bool scribeHandler::configureStore(pStoreConf store_conf, int *numstores) { // create a store for each category vector::iterator iter; for (iter = category_list.begin(); iter < category_list.end(); iter++) { - shared_ptr result = + boost::shared_ptr result = configureStoreCategory(store_conf, *iter, model); if (!result) { @@ -734,7 +734,7 @@ bool scribeHandler::configureStore(pStoreConf store_conf, int *numstores) { // Configures the store specified by the store configuration and category. -shared_ptr scribeHandler::configureStoreCategory( +boost::shared_ptr scribeHandler::configureStoreCategory( pStoreConf store_conf, //configuration for store const string &category, //category name const boost::shared_ptr &model, //model to use (optional) @@ -745,7 +745,7 @@ shared_ptr scribeHandler::configureStoreCategory( if (category.empty()) { setStatusDetails("Bad config - store with blank category"); - return shared_ptr(); + return boost::shared_ptr(); } LOG_OPER("CATEGORY : %s", category.c_str()); @@ -763,17 +763,17 @@ shared_ptr scribeHandler::configureStoreCategory( string errormsg("Bad config - no type for store with category: "); errormsg += category; setStatusDetails(errormsg); - return shared_ptr(); + return boost::shared_ptr(); } // look for the store in the current list - shared_ptr pstore; + boost::shared_ptr pstore; try { if (model != NULL) { // Create a copy of the model if we want a new thread per category if (newThreadPerCategory && !is_default && !is_prefix_category) { - pstore = shared_ptr(new StoreQueue(model, category)); + pstore = boost::shared_ptr(new StoreQueue(model, category)); } else { pstore = model; already_created = true; @@ -798,7 +798,7 @@ shared_ptr scribeHandler::configureStoreCategory( is_model = newThreadPerCategory && categories; pstore = - shared_ptr(new StoreQueue(type, store_name, checkPeriod, + boost::shared_ptr(new StoreQueue(type, store_name, checkPeriod, is_model, multi_category)); } } catch (...) { @@ -809,7 +809,7 @@ shared_ptr scribeHandler::configureStoreCategory( string errormsg("Bad config - can't create a store of type: "); errormsg += type; setStatusDetails(errormsg); - return shared_ptr(); + return boost::shared_ptr(); } // open store. and configure it if not copied from a model @@ -826,23 +826,23 @@ shared_ptr scribeHandler::configureStoreCategory( LOG_OPER("Creating default store"); defaultStores.push_back(pstore); } else if (is_prefix_category) { - shared_ptr pstores; + boost::shared_ptr pstores; category_map_t::iterator category_iter = category_prefixes.find(category); if (category_iter != category_prefixes.end()) { pstores = category_iter->second; } else { - pstores = shared_ptr(new store_list_t); + pstores = boost::shared_ptr(new store_list_t); category_prefixes[category] = pstores; } pstores->push_back(pstore); } else if (!pstore->isModelStore()) { // push the new store onto the new map if it's not just a model - shared_ptr pstores; + boost::shared_ptr pstores; category_map_t::iterator category_iter = categories.find(category); if (category_iter != categories.end()) { pstores = category_iter->second; } else { - pstores = shared_ptr(new store_list_t); + pstores = boost::shared_ptr(new store_list_t); categories[category] = pstores; } pstores->push_back(pstore); @@ -857,7 +857,7 @@ void scribeHandler::deleteCategoryMap(category_map_t& cats) { for (category_map_t::iterator cat_iter = cats.begin(); cat_iter != cats.end(); ++cat_iter) { - shared_ptr pstores = cat_iter->second; + boost::shared_ptr pstores = cat_iter->second; if (!pstores) { throw std::logic_error("deleteCategoryMap: " "iterator in category map holds null pointer"); diff --git a/src/store.cpp b/src/store.cpp index d0ba5400..46d9942f 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -84,34 +84,34 @@ Store::createStore(StoreQueue* storeq, const string& type, const string& category, bool readable, bool multi_category) { if (0 == type.compare("file")) { - return shared_ptr(new FileStore(storeq, category, multi_category, + return boost::shared_ptr(new FileStore(storeq, category, multi_category, readable)); } else if (0 == type.compare("buffer")) { - return shared_ptr(new BufferStore(storeq,category, multi_category)); + return boost::shared_ptr(new BufferStore(storeq,category, multi_category)); } else if (0 == type.compare("network")) { - return shared_ptr(new NetworkStore(storeq, category, + return boost::shared_ptr(new NetworkStore(storeq, category, multi_category)); } else if (0 == type.compare("bucket")) { - return shared_ptr(new BucketStore(storeq, category, + return boost::shared_ptr(new BucketStore(storeq, category, multi_category)); } else if (0 == type.compare("thriftfile")) { - return shared_ptr(new ThriftFileStore(storeq, category, + return boost::shared_ptr(new ThriftFileStore(storeq, category, multi_category)); } else if (0 == type.compare("null")) { - return shared_ptr(new NullStore(storeq, category, multi_category)); + return boost::shared_ptr(new NullStore(storeq, category, multi_category)); } else if (0 == type.compare("multi")) { - return shared_ptr(new MultiStore(storeq, category, multi_category)); + return boost::shared_ptr(new MultiStore(storeq, category, multi_category)); } else if (0 == type.compare("category")) { - return shared_ptr(new CategoryStore(storeq, category, + return boost::shared_ptr(new CategoryStore(storeq, category, multi_category)); } else if (0 == type.compare("multifile")) { - return shared_ptr(new MultiFileStore(storeq, category, + return boost::shared_ptr(new MultiFileStore(storeq, category, multi_category)); } else if (0 == type.compare("thriftmultifile")) { - return shared_ptr(new ThriftMultiFileStore(storeq, category, + return boost::shared_ptr(new ThriftMultiFileStore(storeq, category, multi_category)); } else { - return shared_ptr(); + return boost::shared_ptr(); } } @@ -764,10 +764,10 @@ void FileStore::flush() { } } -shared_ptr FileStore::copy(const std::string &category) { +boost::shared_ptr FileStore::copy(const std::string &category) { FileStore *store = new FileStore(storeQueue, category, multiCategory, isBufferFile); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); store->addNewlines = addNewlines; store->copyCommon(this); @@ -916,7 +916,7 @@ void FileStore::deleteOldest(struct tm* now) { if (index < 0) { return; } - shared_ptr deletefile = FileInterface::createFileInterface(fsType, + boost::shared_ptr deletefile = FileInterface::createFileInterface(fsType, makeFullFilename(index, now)); if (lostBytes_) { g_Handler->incCounter(categoryHandled, "bytes lost", lostBytes_); @@ -940,7 +940,7 @@ bool FileStore::replaceOldest(boost::shared_ptr messages, // Need to close and reopen store in case we already have this file open close(); - shared_ptr infile = FileInterface::createFileInterface(fsType, + boost::shared_ptr infile = FileInterface::createFileInterface(fsType, filename, isBufferFile); // overwrite the old contents of the file @@ -974,7 +974,7 @@ bool FileStore::readOldest(/*out*/ boost::shared_ptr messages } std::string filename = makeFullFilename(index, now); - shared_ptr infile = FileInterface::createFileInterface(fsType, + boost::shared_ptr infile = FileInterface::createFileInterface(fsType, filename, isBufferFile); if (!infile->openRead()) { @@ -1033,7 +1033,7 @@ bool FileStore::empty(struct tm* now) { int suffix = getFileSuffix(*iter, base_filename); if (-1 != suffix) { std::string fullname = makeFullFilename(suffix, now); - shared_ptr file = FileInterface::createFileInterface(fsType, + boost::shared_ptr file = FileInterface::createFileInterface(fsType, fullname); if (file->fileSize()) { return false; @@ -1057,9 +1057,9 @@ ThriftFileStore::ThriftFileStore(StoreQueue* storeq, ThriftFileStore::~ThriftFileStore() { } -shared_ptr ThriftFileStore::copy(const std::string &category) { +boost::shared_ptr ThriftFileStore::copy(const std::string &category) { ThriftFileStore *store = new ThriftFileStore(storeQueue, category, multiCategory); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); store->flushFrequencyMs = flushFrequencyMs; store->msgBufferSize = msgBufferSize; @@ -1434,9 +1434,9 @@ void BufferStore::flush() { } } -shared_ptr BufferStore::copy(const std::string &category) { +boost::shared_ptr BufferStore::copy(const std::string &category) { BufferStore *store = new BufferStore(storeQueue, category, multiCategory); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); store->bufferSendRate = bufferSendRate; store->avgRetryInterval = avgRetryInterval; @@ -1904,7 +1904,7 @@ bool NetworkStore::open() { LOG_OPER("Logic error: NetworkStore::open unpooledConn is not NULL" " service = %s", serviceName.c_str()); } - unpooledConn = shared_ptr(new scribeConn(serviceName, + unpooledConn = boost::shared_ptr(new scribeConn(serviceName, servers, static_cast(timeout))); opened = unpooledConn->open(); if (!opened) { @@ -1927,7 +1927,7 @@ bool NetworkStore::open() { LOG_OPER("Logic error: NetworkStore::open unpooledConn is not NULL" " %s:%lu", remoteHost.c_str(), remotePort); } - unpooledConn = shared_ptr(new scribeConn(remoteHost, + unpooledConn = boost::shared_ptr(new scribeConn(remoteHost, remotePort, static_cast(timeout))); opened = unpooledConn->open(); if (!opened) { @@ -1968,9 +1968,9 @@ bool NetworkStore::isOpen() { return opened; } -shared_ptr NetworkStore::copy(const std::string &category) { +boost::shared_ptr NetworkStore::copy(const std::string &category) { NetworkStore *store = new NetworkStore(storeQueue, category, multiCategory); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); store->useConnPool = useConnPool; store->serviceBased = serviceBased; @@ -2096,7 +2096,7 @@ void BucketStore::createBucketsFromBucket(pStoreConf configuration, for (unsigned int i = 0; i <= numBuckets; ++i) { - shared_ptr newstore = + boost::shared_ptr newstore = createStore(storeQueue, type, categoryHandled, false, multiCategory); if (!newstore) { @@ -2175,7 +2175,7 @@ void BucketStore::createBuckets(pStoreConf configuration) { goto handle_error; } - shared_ptr bucket = + boost::shared_ptr bucket = createStore(storeQueue, type, categoryHandled, false, multiCategory); buckets.push_back(bucket); @@ -2324,7 +2324,7 @@ bool BucketStore::open() { return false; } - for (std::vector >::iterator iter = buckets.begin(); + for (std::vector >::iterator iter = buckets.begin(); iter != buckets.end(); ++iter) { @@ -2346,7 +2346,7 @@ void BucketStore::close() { // don't check opened, because we can call this when some, but // not all, contained stores are opened. Calling close on a contained // store that's already closed shouldn't hurt anything. - for (std::vector >::iterator iter = buckets.begin(); + for (std::vector >::iterator iter = buckets.begin(); iter != buckets.end(); ++iter) { (*iter)->close(); @@ -2355,7 +2355,7 @@ void BucketStore::close() { } void BucketStore::flush() { - for (std::vector >::iterator iter = buckets.begin(); + for (std::vector >::iterator iter = buckets.begin(); iter != buckets.end(); ++iter) { (*iter)->flush(); @@ -2366,7 +2366,7 @@ string BucketStore::getStatus() { string retval = Store::getStatus(); - std::vector >::iterator iter = buckets.begin(); + std::vector >::iterator iter = buckets.begin(); while (retval.empty() && iter != buckets.end()) { retval = (*iter)->getStatus(); ++iter; @@ -2390,15 +2390,15 @@ void BucketStore::periodicCheck() { } } -shared_ptr BucketStore::copy(const std::string &category) { +boost::shared_ptr BucketStore::copy(const std::string &category) { BucketStore *store = new BucketStore(storeQueue, category, multiCategory); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); store->numBuckets = numBuckets; store->bucketType = bucketType; store->delimiter = delimiter; - for (std::vector >::iterator iter = buckets.begin(); + for (std::vector >::iterator iter = buckets.begin(); iter != buckets.end(); ++iter) { store->buckets.push_back((*iter)->copy(category)); @@ -2417,7 +2417,7 @@ bool BucketStore::handleMessages(boost::shared_ptr messages) bool success = true; boost::shared_ptr failed_messages(new logentry_vector_t); - vector > bucketed_messages; + vector > bucketed_messages; bucketed_messages.resize(numBuckets + 1); if (numBuckets == 0) { @@ -2435,7 +2435,7 @@ bool BucketStore::handleMessages(boost::shared_ptr messages) if (!bucketed_messages[bucket]) { bucketed_messages[bucket] = - shared_ptr (new logentry_vector_t); + boost::shared_ptr (new logentry_vector_t); } bucketed_messages[bucket]->push_back(*iter); @@ -2443,14 +2443,14 @@ bool BucketStore::handleMessages(boost::shared_ptr messages) // handle all batches of messages for (unsigned long i = 0; i <= numBuckets; i++) { - shared_ptr batch = bucketed_messages[i]; + boost::shared_ptr batch = bucketed_messages[i]; if (batch) { if (removeKey) { // Create new set of messages with keys removed - shared_ptr key_removed = - shared_ptr (new logentry_vector_t); + boost::shared_ptr key_removed = + boost::shared_ptr (new logentry_vector_t); for (logentry_vector_t::iterator iter = batch->begin(); iter != batch->end(); @@ -2580,7 +2580,7 @@ NullStore::~NullStore() { boost::shared_ptr NullStore::copy(const std::string &category) { NullStore *store = new NullStore(storeQueue, category, multiCategory); - shared_ptr copied = shared_ptr(store); + boost::shared_ptr copied = boost::shared_ptr(store); return copied; } @@ -2644,7 +2644,7 @@ boost::shared_ptr MultiStore::copy(const std::string &category) { store->stores.push_back(tmp_copy); } - return shared_ptr(store); + return boost::shared_ptr(store); } bool MultiStore::open() { @@ -2816,13 +2816,13 @@ boost::shared_ptr CategoryStore::copy(const std::string &category) { store->modelStore = modelStore->copy(category); - return shared_ptr(store); + return boost::shared_ptr(store); } bool CategoryStore::open() { bool result = true; - for (map >::iterator iter = stores.begin(); + for (map >::iterator iter = stores.begin(); iter != stores.end(); ++iter) { result &= iter->second->open(); @@ -2833,7 +2833,7 @@ bool CategoryStore::open() { bool CategoryStore::isOpen() { - for (map >::iterator iter = stores.begin(); + for (map >::iterator iter = stores.begin(); iter != stores.end(); ++iter) { if (!iter->second->isOpen()) { @@ -2890,7 +2890,7 @@ void CategoryStore::configureCommon(pStoreConf configuration, } void CategoryStore::close() { - for (map >::iterator iter = stores.begin(); + for (map >::iterator iter = stores.begin(); iter != stores.end(); ++iter) { iter->second->close(); @@ -2898,15 +2898,15 @@ void CategoryStore::close() { } bool CategoryStore::handleMessages(boost::shared_ptr messages) { - shared_ptr singleMessage(new logentry_vector_t); - shared_ptr failed_messages(new logentry_vector_t); + boost::shared_ptr singleMessage(new logentry_vector_t); + boost::shared_ptr failed_messages(new logentry_vector_t); logentry_vector_t::iterator message_iter; for (message_iter = messages->begin(); message_iter != messages->end(); ++message_iter) { - map >::iterator store_iter; - shared_ptr store; + map >::iterator store_iter; + boost::shared_ptr store; string category = (*message_iter)->category; store_iter = stores.find(category); @@ -2949,7 +2949,7 @@ bool CategoryStore::handleMessages(boost::shared_ptr messages } void CategoryStore::periodicCheck() { - for (map >::iterator iter = stores.begin(); + for (map >::iterator iter = stores.begin(); iter != stores.end(); ++iter) { iter->second->periodicCheck(); @@ -2957,7 +2957,7 @@ void CategoryStore::periodicCheck() { } void CategoryStore::flush() { - for (map >::iterator iter = stores.begin(); + for (map >::iterator iter = stores.begin(); iter != stores.end(); ++iter) { iter->second->flush(); diff --git a/src/store_queue.cpp b/src/store_queue.cpp index 9d969d16..aa7fec91 100644 --- a/src/store_queue.cpp +++ b/src/store_queue.cpp @@ -175,7 +175,7 @@ void StoreQueue::open() { } } -shared_ptr StoreQueue::copyStore(const std::string &category) { +boost::shared_ptr StoreQueue::copyStore(const std::string &category) { return store->copy(category); } @@ -306,7 +306,7 @@ void StoreQueue::threadMember() { store->close(); } -void StoreQueue::processFailedMessages(shared_ptr messages) { +void StoreQueue::processFailedMessages(boost::shared_ptr messages) { // If the store was not able to process these messages, we will either // requeue them or give up depending on the value of mustSucceed