Package org.apache.hedwig.server.common

Examples of org.apache.hedwig.server.common.UnexpectedError


     *
     * @param obj
     */
    protected void enqueueWithoutFailure(CacheRequest obj) {
        if (!requestQueue.offer(obj)) {
            throw new UnexpectedError("Could not enqueue object: " + obj.toString()
                                      + " to cache request queue. Exiting.");

        }
    }
View Full Code Here


        return message == null;
    }

    public long getTimeOfAddition() {
        if (message == null) {
            throw new UnexpectedError("Time of add requested from a stub");
        }
        return timeOfAddition;
    }
View Full Code Here

     * never happen
     *
     */
    protected void enqueueWithoutFailure(DeliveryManagerRequest request) {
        if (!requestQueue.offer(request)) {
            throw new UnexpectedError("Could not enqueue object: " + request + " to delivery manager request queue.");
        }
    }
View Full Code Here

    public void retryErroredSubscriberAfterDelay(ActiveSubscriberState subscriber) {

        subscriber.setLastScanErrorTime(System.currentTimeMillis());

        if (!retryQueue.offer(subscriber)) {
            throw new UnexpectedError("Could not enqueue to delivery manager retry queue");
        }
    }
View Full Code Here

        // remove this subscriber from the delivery pointers data structure
        ByteString topic = subscriber.getTopic();
        SortedMap<Long, Set<ActiveSubscriberState>> deliveryPtrs = perTopicDeliveryPtrs.get(topic);

        if (deliveryPtrs == null && !isAbsenceOk) {
            throw new UnexpectedError("No delivery pointers found while disconnecting " + "channel for topic:" + topic);
        }

        if(null == deliveryPtrs) {
            return;
        }

        if (!MapMethods.removeFromMultiMap(deliveryPtrs, seqId, subscriber) && !isAbsenceOk) {

            throw new UnexpectedError("Could not find subscriber:" + subscriber + " at the expected delivery pointer");
        }

        if (pruneTopic && deliveryPtrs.isEmpty()) {
            perTopicDeliveryPtrs.remove(topic);
        }
View Full Code Here

    public void operationComplete(ChannelFuture future) throws Exception {
        DeliveryCallback callback = callbacks.get(future);
        callbacks.remove(future);

        if (callback == null) {
            throw new UnexpectedError("Could not locate callback for channel future");
        }

        if (future.isSuccess()) {
            callback.sendingFinished();
        } else {
View Full Code Here

                        String msg = "Expected BK to assign entry-id: "
                                     + (localSeqId - topicInfo.currentLedgerRange.startSeqIdIncluded)
                                     + " but it instead assigned entry-id: " + entryId + " topic: "
                                     + topic.toStringUtf8() + "ledger: " + lh.getId();
                        logger.error(msg);
                        throw new UnexpectedError(msg);
                    }

                    topicInfo.lastEntryIdAckedInCurrentLedger = entryId;
                    request.callback.operationFinished(ctx, localSeqId);
                }
View Full Code Here

     * never happen
     *
     */
    protected void enqueueWithoutFailure(DeliveryManagerRequest request) {
        if (!requestQueue.offer(request)) {
            throw new UnexpectedError("Could not enqueue object: " + request + " to delivery manager request queue.");
        }
    }
View Full Code Here

    public void retryErroredSubscriberAfterDelay(ActiveSubscriberState subscriber) {

        subscriber.setLastScanErrorTime(MathUtils.now());

        if (!retryQueue.offer(subscriber)) {
            throw new UnexpectedError("Could not enqueue to delivery manager retry queue");
        }
    }
View Full Code Here

    }

    public void clearRetryDelayForSubscriber(ActiveSubscriberState subscriber) {
        subscriber.clearLastScanErrorTime();
        if (!retryQueue.offer(subscriber)) {
            throw new UnexpectedError("Could not enqueue to delivery manager retry queue");
        }
        // no request in request queue now
        // issue a empty delivery request to not waiting for polling requests queue
        if (requestQueue.isEmpty()) {
            enqueueWithoutFailure(new DeliveryManagerRequest() {
View Full Code Here

TOP

Related Classes of org.apache.hedwig.server.common.UnexpectedError

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.