use of org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage in project ignite by apache.
the class CacheBlockOnCreateDestoryIndexTest method doTestCreateIndex.
/**
* @throws Exception If failed.
*/
private void doTestCreateIndex() throws Exception {
IgniteEx ignite = currentTest().baseline().get(0);
List<T3<String, String, String>> caches = createCaches(ignite);
currentTest().doTest(msg -> msg instanceof SchemaOperationStatusMessage, () -> createIndex(ignite, caches.remove(caches.size() - 1)));
}
use of org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage in project ignite by apache.
the class GridQueryProcessor method unwindPendingMessages.
/**
* Unwind pending messages for particular operation.
*
* @param opId Operation ID.
* @param mgr Manager.
*/
private void unwindPendingMessages(UUID opId, SchemaOperationManager mgr) {
assert Thread.holdsLock(stateMux);
Iterator<SchemaOperationStatusMessage> it = pendingMsgs.iterator();
while (it.hasNext()) {
SchemaOperationStatusMessage msg = it.next();
if (F.eq(msg.operationId(), opId)) {
mgr.onNodeFinished(msg.senderNodeId(), unmarshalSchemaError(msg.errorBytes()));
it.remove();
}
}
}
use of org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage in project ignite by apache.
the class GridQueryProcessor method sendStatusMessage.
/**
* Send status message to coordinator node.
*
* @param destNodeId Destination node ID.
* @param opId Operation ID.
* @param err Error.
*/
public void sendStatusMessage(UUID destNodeId, UUID opId, SchemaOperationException err) {
if (log.isDebugEnabled())
log.debug("Sending schema operation status message [opId=" + opId + ", crdNode=" + destNodeId + ", err=" + err + ']');
try {
byte[] errBytes = marshalSchemaError(opId, err);
SchemaOperationStatusMessage msg = new SchemaOperationStatusMessage(opId, errBytes);
// Messages must go to dedicated schema pool. We cannot push them to query pool because in this case
// they could be blocked with other query requests.
ctx.io().sendToGridTopic(destNodeId, TOPIC_SCHEMA, msg, SCHEMA_POOL);
} catch (IgniteCheckedException e) {
if (log.isDebugEnabled())
log.debug("Failed to send schema status response [opId=" + opId + ", destNodeId=" + destNodeId + ", err=" + e + ']');
}
}
use of org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage in project ignite by apache.
the class CacheBlockOnCreateDestoryIndexTest method doTestDestroyIndex.
/**
* @throws Exception If failed.
*/
private void doTestDestroyIndex() throws Exception {
IgniteEx ignite = currentTest().baseline().get(0);
List<T3<String, String, String>> caches = createCaches(ignite);
for (T3<String, String, String> pair : caches) createIndex(ignite, pair);
currentTest().doTest(msg -> msg instanceof SchemaOperationStatusMessage, () -> destroyIndex(ignite, caches.remove(caches.size() - 1)));
}
Aggregations