2323
2424#include " qpid/linearstore/jrnl/jerrno.h"
2525#include " qpid/linearstore/jrnl/jexception.h"
26+ #include " qpid/linearstore/jrnl/EmptyFilePool.h"
2627#include " qpid/log/Statement.h"
2728#include " qpid/management/ManagementAgent.h"
28- #include " qmf/org/apache/qpid/linearstore/ArgsJournalExpand.h"
29+ // #include "qmf/org/apache/qpid/linearstore/ArgsJournalExpand.h"
2930#include " qmf/org/apache/qpid/linearstore/EventCreated.h"
3031#include " qmf/org/apache/qpid/linearstore/EventEnqThresholdExceeded.h"
3132#include " qmf/org/apache/qpid/linearstore/EventFull.h"
3233#include " qmf/org/apache/qpid/linearstore/EventRecovered.h"
3334#include " qpid/sys/Monitor.h"
3435#include " qpid/sys/Timer.h"
35- #include " qpid/linearstore/Log .h"
36+ #include " qpid/linearstore/QpidLog .h"
3637#include " qpid/linearstore/StoreException.h"
3738
3839using namespace qpid ::qls_jrnl;
@@ -53,22 +54,23 @@ void GetEventsFireEvent::fire() { qpid::sys::Mutex::ScopedLock sl(_gefe_lock); i
5354JournalImpl::JournalImpl (qpid::sys::Timer& timer_,
5455 const std::string& journalId,
5556 const std::string& journalDirectory,
56- const std::string& journalBaseFilename,
57+ // const std::string& journalBaseFilename,
5758 const qpid::sys::Duration getEventsTimeout,
5859 const qpid::sys::Duration flushTimeout,
5960 qpid::management::ManagementAgent* a,
6061 DeleteCallback onDelete):
61- jcntl(journalId, journalDirectory, journalBaseFilename),
62+ jcntl(journalId, journalDirectory/* , journalBaseFilename*/ ),
6263 timer(timer_),
6364 getEventsTimerSetFlag(false ),
64- lastReadRid(0 ),
65+ efpp(0 ),
66+ // lastReadRid(0),
6567 writeActivityFlag(false ),
6668 flushTriggeredFlag(true ),
67- _xidp(0 ),
68- _datap(0 ),
69- _dlen(0 ),
70- _dtok(),
71- _external(false ),
69+ // _xidp(0),
70+ // _datap(0),
71+ // _dlen(0),
72+ // _dtok(),
73+ // _external(false),
7274 deleteCallback(onDelete)
7375{
7476 getEventsFireEventsPtr = new GetEventsFireEvent (this , getEventsTimeout);
@@ -82,7 +84,7 @@ JournalImpl::JournalImpl(qpid::sys::Timer& timer_,
8284
8385 QLS_LOG2 (notice, _jid, " Created" );
8486 std::ostringstream oss;
85- oss << " Journal directory = \" " << journalDirectory << " \" ; Base file name = \" " << journalBaseFilename << " \" " ;
87+ oss << " Journal directory = \" " << journalDirectory << " \" " ;
8688 QLS_LOG2 (debug, _jid, oss.str ());
8789}
8890
@@ -95,7 +97,7 @@ JournalImpl::~JournalImpl()
9597 }
9698 getEventsFireEventsPtr->cancel ();
9799 inactivityFireEventPtr->cancel ();
98- free_read_buffers ();
100+ // free_read_buffers();
99101
100102 if (_mgmtObject.get () != 0 ) {
101103 _mgmtObject->resourceDestroy ();
@@ -116,14 +118,14 @@ JournalImpl::initManagement(qpid::management::ManagementAgent* a)
116118
117119 _mgmtObject->set_name (_jid);
118120 _mgmtObject->set_directory (_jdir.dirname ());
119- _mgmtObject->set_baseFileName (_base_filename);
121+ // _mgmtObject->set_baseFileName(_base_filename);
120122 _mgmtObject->set_readPageSize (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
121123 _mgmtObject->set_readPages (JRNL_RMGR_PAGES);
122124
123125 // The following will be set on initialize(), but being properties, these must be set to 0 in the meantime
124- _mgmtObject->set_initialFileCount (0 );
125- _mgmtObject->set_dataFileSize (0 );
126- _mgmtObject->set_currentFileCount (0 );
126+ // _mgmtObject->set_initialFileCount(0);
127+ // _mgmtObject->set_dataFileSize(0);
128+ // _mgmtObject->set_currentFileCount(0);
127129 _mgmtObject->set_writePageSize (0 );
128130 _mgmtObject->set_writePages (0 );
129131
@@ -133,22 +135,23 @@ JournalImpl::initManagement(qpid::management::ManagementAgent* a)
133135
134136
135137void
136- JournalImpl::initialize (/* const uint16_t num_jfiles,
137- const bool auto_expand,
138- const uint16_t ae_max_jfiles,
139- const uint32_t jfsize_sblks,*/
138+ JournalImpl::initialize (qpid::qls_jrnl::EmptyFilePool* efpp_,
140139 const uint16_t wcache_num_pages,
141140 const uint32_t wcache_pgsize_sblks,
142141 qpid::qls_jrnl::aio_callback* const cbp)
143142{
144- std::ostringstream oss;
145- // oss << "Initialize; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
146- oss << " Initialize;" ;
147- oss << " wcache_pgsize_sblks=" << wcache_pgsize_sblks;
148- oss << " wcache_num_pages=" << wcache_num_pages;
149- QLS_LOG2 (debug, _jid, oss.str ());
150- jcntl::initialize (/* num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks,*/ wcache_num_pages, wcache_pgsize_sblks, cbp);
151- QLS_LOG2 (debug, _jid, " Initialization complete" );
143+ efpp = efpp_;
144+ // efpp->createJournal(_jdir);
145+ // QLS_LOG2(notice, _jid, "Initialized");
146+ // std::ostringstream oss;
147+ // // oss << "Initialize; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
148+ // oss << "Initialize; efpPartitionNumber=" << efpp_->getPartitionNumber();
149+ // oss << " efpFileSizeKb=" << efpp_->fileSizeKib();
150+ // oss << " wcache_pgsize_sblks=" << wcache_pgsize_sblks;
151+ // oss << " wcache_num_pages=" << wcache_num_pages;
152+ // QLS_LOG2(debug, _jid, oss.str());
153+ jcntl::initialize (/* num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks,*/ efpp, wcache_num_pages, wcache_pgsize_sblks, cbp);
154+ // QLS_LOG2(debug, _jid, "Initialization complete");
152155 // TODO: replace for linearstore: _lpmgr
153156/*
154157 if (_mgmtObject.get() != 0)
@@ -261,6 +264,7 @@ JournalImpl::recover_complete()
261264// #define AIO_SLEEP_TIME_US 10 // 0.01 ms
262265// Return true if content is recovered from store; false if content is external and must be recovered from an external store.
263266// Throw exception for all errors.
267+ /*
264268bool
265269JournalImpl::loadMsgContent(uint64_t rid, std::string& data, size_t length, size_t offset)
266270{
@@ -351,6 +355,7 @@ JournalImpl::loadMsgContent(uint64_t rid, std::string& data, size_t length, size
351355 }
352356 return true;
353357}
358+ */
354359
355360void
356361JournalImpl::enqueue_data_record (const void * const data_buff, const size_t tot_data_len,
574579JournalImpl::rd_aio_cb (std::vector<uint16_t >& /* pil*/ )
575580{}
576581
582+ /*
577583void
578584JournalImpl::free_read_buffers()
579585{
@@ -586,6 +592,12 @@ JournalImpl::free_read_buffers()
586592 _datap = 0;
587593 }
588594}
595+ */
596+
597+ void
598+ JournalImpl::createStore () {
599+
600+ }
589601
590602void
591603JournalImpl::handleIoResult (const iores r)
@@ -624,12 +636,13 @@ JournalImpl::handleIoResult(const iores r)
624636 }
625637}
626638
627- qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t methodId,
639+ qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t /* methodId*/ ,
628640 qpid::management::Args& /* args*/ ,
629641 std::string& /* text*/ )
630642{
631643 Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
632644
645+ /*
633646 switch (methodId)
634647 {
635648 case _qmf::Journal::METHOD_EXPAND :
@@ -640,6 +653,7 @@ qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t m
640653 status = Manageable::STATUS_NOT_IMPLEMENTED;
641654 break;
642655 }
656+ */
643657
644658 return status;
645659}
0 commit comments