Package com.blacklocus.qs.worker.model

Examples of com.blacklocus.qs.worker.model.QSTaskModel


        @Override
        protected void go() throws Exception {
            // If the heap is filling up, this should block for a bit. queueStrategy.on*Remove called when
            // task processing completes in the WorkerQueueItemHandler.
            queueingStrategy.onBeforeAdd(null);
            QSTaskModel task = taskService.getAvailableTask();
            taskServices.put(task, taskService);
            transferQueue.put(task);
            queueingStrategy.onAfterAdd();
        }
View Full Code Here


        if (!iterator.hasNext()) {
            pageForward();
        }
        S3ObjectSummary obj = iterator.next();
        assert obj != null;
        return new QSTaskModel(listingBatchId, IdSupplier.newId(), taskHandlerIdentifier, ImmutableMap.<String, Object>of(PARAM_OBJECT, obj));
    }
View Full Code Here

        this.objectMapper = new ObjectMapper();
    }

    @Override
    public QSTaskModel getAvailableTask() {
        QSTaskModel task = null;
        while (task == null) {
            ReceiveMessageResult result = sqs.receiveMessage(new ReceiveMessageRequest(queueUrl).withMaxNumberOfMessages(1));
            assert result.getMessages().size() <= 1;

            if (result.getMessages().size() == 1) {
View Full Code Here

        return task;
    }

    @Override
    public Object process(TaskHandle taskHandle) throws Exception {
        QSTaskModel task = taskHandle.task;
        QSWorker worker = workers.get(task.handler);
        if (worker == null) {
            throw new RuntimeException("No worker available for handler identifier: " + task.handler);
        }
View Full Code Here

    @Override
    public void onError(TaskHandle taskHandle, Throwable throwable) {
        queueingStrategy.onBeforeRemove();

        QSTaskModel task = taskHandle.task;
        taskService.resetTask(task);

        ImmutableMap<String, ImmutableMap<String, String>> exceptionDetails = ImmutableMap.of("exception", ImmutableMap.of(
                "class", throwable.getClass().getName(),
                "message", throwable.getMessage(),
View Full Code Here

        @Override
        protected void go() throws Exception {
            // If the heap is filling up, this should block for a bit. queueStrategy.on*Remove called when
            // task processing completes in the WorkerQueueItemHandler.
            queueingStrategy.onBeforeAdd(null);
            QSTaskModel task = taskService.getAvailableTask();
            taskServices.put(task, taskService);
            transferQueue.put(task);
            queueingStrategy.onAfterAdd();
        }
View Full Code Here

        if (!iterator.hasNext()) {
            pageForward();
        }
        S3ObjectSummary obj = iterator.next();
        assert obj != null;
        return new QSTaskModel(listingBatchId, IdSupplier.newId(), taskHandlerIdentifier, 5, ObjectMappers.valueToTree(obj));
    }
View Full Code Here

        }
    }

    @Override
    public QSTaskModel getAvailableTask() {
        QSTaskModel task = null;
        while (task == null) {
            ReceiveMessageResult result = sqs.receiveMessage(new ReceiveMessageRequest(queueUrl).withMaxNumberOfMessages(1));
            assert result.getMessages().size() <= 1;

            if (result.getMessages().size() == 1) {
View Full Code Here

TOP

Related Classes of com.blacklocus.qs.worker.model.QSTaskModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.