Akonadi
preprocessormanager.cpp
52 QDBusConnection::sessionBus().registerObject(QStringLiteral("/PreprocessorManager"), this, QDBusConnection::ExportAdaptors);
70 qDeleteAll(mTransactionWaitQueueHash); // this should also disconnect all the signals from the data store objects...
107 // In that case we'll need to fiddle with the items that are currently enqueued for processing...
111 mTracer.warning(QStringLiteral("PreprocessorManager"), QStringLiteral("Could not initialize preprocessor instance '%1'").arg(id));
134 return; // not our instance: don't complain (as we might be called for non-preprocessor agents too)
137 // All of the preprocessor's waiting items must be queued to the next preprocessor (if there is one)
180 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::beginHandleItem(" << item.id() << ") called with a disabled preprocessor";
188 Q_ASSERT_X(item.hidden(), "PreprocessorManager::beginHandleItem()", "The item you pass to this function should be hidden!");
211 QObject::connect(dataStore, &QObject::destroyed, this, &PreprocessorManager::dataStoreDestroyed);
212 QObject::connect(dataStore, &DataStore::transactionCommitted, this, &PreprocessorManager::dataStoreTransactionCommitted);
213 QObject::connect(dataStore, &DataStore::transactionRolledBack, this, &PreprocessorManager::dataStoreTransactionRolledBack);
238 // FIXME: Am I *really* sure of this ? If I'm wrong for some obscure reason then we have a deadlock.
245 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::lockedKillWaitQueue(): called for dataStore which has no wait queue";
257 QObject::disconnect(dataStore, &QObject::destroyed, this, &PreprocessorManager::dataStoreDestroyed);
258 QObject::disconnect(dataStore, &DataStore::transactionCommitted, this, &PreprocessorManager::dataStoreTransactionCommitted);
259 QObject::disconnect(dataStore, &DataStore::transactionRolledBack, this, &PreprocessorManager::dataStoreTransactionRolledBack);
266 qCDebug(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreDestroyed(): killing the wait queue";
270 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreDestroyed(): got the signal from a non DataStore object";
281 qCDebug(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreTransactionCommitted(): pushing items in wait queue to the preprocessing chain";
285 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreTransactionCommitted(): got the signal from a non DataStore object";
291 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreTransactionCommitted(): called for dataStore which has no wait queue";
313 qCDebug(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreTransactionRolledBack(): killing the wait queue";
317 qCWarning(AKONADISERVER_LOG) << "PreprocessorManager::dataStoreTransactionCommitted(): got the signal from a non DataStore object";
324void PreprocessorManager::preProcessorFinishedHandlingItem(PreprocessorInstance *preProcessor, qint64 itemId)
348 // Refetch the PimItem, the Collection and the MimeType now: preprocessing might have changed them.
354 qCDebug(AKONADISERVER_LOG) << "Invalid PIM item id '" << itemId << "' passed to preprocessing chain termination function";
361 qCDebug(AKONADISERVER_LOG) << "The PIM item with id '" << itemId << "' reached the preprocessing chain termination function in unhidden state";
369 QStringLiteral("Failed to unhide the PIM item '%1': data is not lost but a server restart is required in order to unhide it").arg(itemId));
405 QStringLiteral("Preprocessor '%1' seems to be stuck... trying to abort its job.").arg(instance->id()));
416 mTracer.warning(QStringLiteral("PreprocessorManager"), QStringLiteral("Preprocessor '%1' is stuck... trying to restart it").arg(instance->id()));
424 mTracer.warning(QStringLiteral("PreprocessorManager"), QStringLiteral("Preprocessor '%1' is broken... ignoring it from now on").arg(instance->id()));
bool inTransaction() const
Returns true if there is a transaction in progress.
Definition datastore.cpp:1411
void transactionRolledBack()
Emitted if a transaction has been aborted.
void transactionCommitted()
Emitted if a transaction has been successfully committed.
A single preprocessor (agent) instance.
Definition preprocessorinstance.h:39
std::deque< qint64 > * itemQueue()
Returns a pointer to the internal preprocessor instance item queue.
Definition preprocessorinstance.h:139
qint64 currentProcessingTime()
Returns the time in seconds elapsed since the current item was submitted to the slave preprocessor in...
Definition preprocessorinstance.cpp:124
bool abortProcessing()
Attempts to abort the processing of the current item.
Definition preprocessorinstance.cpp:133
void enqueueItem(qint64 itemId)
This is called by PreprocessorManager to enqueue a PimItem for processing by this preprocessor instan...
Definition preprocessorinstance.cpp:63
bool init()
This is called by PreprocessorManager just after the construction in order to connect to the preproce...
Definition preprocessorinstance.cpp:39
bool invokeRestart()
Attempts to invoke the preprocessor slave restart via AgentManager.
Definition preprocessorinstance.cpp:153
void unregisterInstance(const QString &id)
This is called via D-Bus from AgentManager to unregister a preprocessor instance.
Definition preprocessormanager.cpp:121
void preProcessorFinishedHandlingItem(PreprocessorInstance *preProcessor, qint64 itemId)
This is called by PreprocessorInstance to signal that a certain preprocessor has finished handling an...
Definition preprocessormanager.cpp:324
QList< PreprocessorInstance * > mPreprocessorChain
The preprocessor chain.
Definition preprocessormanager.h:78
bool isActive()
Returns true if preprocessing is active in this Akonadi server.
Definition preprocessormanager.cpp:73
bool mEnabled
Is preprocessing enabled at all in this Akonadi server instance? This is true by default and can be s...
Definition preprocessormanager.h:85
void beginHandleItem(const PimItem &item, const DataStore *dataStore)
Trigger the preprocessor chain for the specified item.
Definition preprocessormanager.cpp:165
PreprocessorManager(Tracer &tracer)
Creates an instance of PreprocessorManager.
Definition preprocessormanager.cpp:45
~PreprocessorManager() override
Destroys the instance of PreprocessorManager and frees all the relevant resources.
Definition preprocessormanager.cpp:61
void registerInstance(const QString &id)
This is called via D-Bus from AgentManager to register a preprocessor instance.
Definition preprocessormanager.cpp:94
QHash< const DataStore *, std::deque< qint64 > * > mTransactionWaitQueueHash
The hashtable of transaction wait queues.
Definition preprocessormanager.h:69
QMutex mMutex
The mutex used to protect the internals of this class (mainly the mPreprocessorChain member).
Definition preprocessormanager.h:91
The global tracer instance where all akonadi components can send their tracing information to.
Definition tracer.h:38
void warning(const QString &componentName, const QString &msg) override
This method is called whenever a component wants to output a warning.
Definition tracer.cpp:117
Helper integration between Akonadi and Qt.
ExportAdaptors
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
QDBusConnection sessionBus()
void append(QList< T > &&value)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
QObject * sender() const const
Server
QString & append(QChar ch)
void start()
void stop()
void timeout()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.