Search in sources :

Example 1 with SchemaOperationStatusMessage

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)));
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) SchemaOperationStatusMessage(org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage) T3(org.apache.ignite.internal.util.typedef.T3)

Example 2 with SchemaOperationStatusMessage

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();
        }
    }
}
Also used : SchemaOperationStatusMessage(org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage)

Example 3 with SchemaOperationStatusMessage

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 + ']');
    }
}
Also used : IgniteCheckedException(org.apache.ignite.IgniteCheckedException) SchemaOperationStatusMessage(org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage)

Example 4 with SchemaOperationStatusMessage

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)));
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) SchemaOperationStatusMessage(org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage) T3(org.apache.ignite.internal.util.typedef.T3)

Aggregations

SchemaOperationStatusMessage (org.apache.ignite.internal.processors.query.schema.message.SchemaOperationStatusMessage)4 IgniteEx (org.apache.ignite.internal.IgniteEx)2 T3 (org.apache.ignite.internal.util.typedef.T3)2 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1