Package com.hazelcast.logging

Examples of com.hazelcast.logging.ILogger


                    RecoveredTransaction rt = (RecoveredTransaction) clientEngine.toObject(data);
                    service.addClientRecoveredTransaction(rt);
                    xids.add(clientEngine.toData(rt.getXid()));
                }
            } catch (MemberLeftException e) {
                ILogger logger = clientEngine.getLogger(RecoverAllTransactionsRequest.class);
                logger.warning("Member left while recovering: " + e);
            } catch (Throwable e) {
                handleException(clientEngine, e);
            }
        }
        ClientEndpoint endpoint = getEndpoint();
View Full Code Here


    }

    private void handleException(ClientEngine clientEngine, Throwable e) {
        Throwable cause = getCause(e);
        if (cause instanceof TargetNotMemberException) {
            ILogger logger = clientEngine.getLogger(RecoverAllTransactionsRequest.class);
            logger.warning("Member left while recovering: " + cause);
        } else {
            throw ExceptionUtil.rethrow(e);
        }
    }
View Full Code Here

            response = false;
        }
    }

    private void logBackupVersionMismatch(long currentVersion) {
        ILogger logger = getLogger();
        if (logger.isFinestEnabled()) {
            logger.finest("Partition: " + getPartitionId() + " version is not matching to version of the owner -> "
                    + currentVersion + " -vs- " + version);
        }
    }
View Full Code Here

        this.mapName = mapName;
    }

    public void process(EntryTaskScheduler<Data, Object> scheduler, Collection<ScheduledEntry<Data, Object>> entries) {
        final Collection<Future> futures = new ArrayList<Future>(entries.size());
        final ILogger logger = nodeEngine.getLogger(getClass());

        for (ScheduledEntry<Data, Object> entry : entries) {
            Data key = entry.getKey();
            int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
                // execute eviction if the node is owner of the key (it can be backup)
            if (nodeEngine.getThisAddress().equals(nodeEngine.getPartitionService().getPartitionOwner(partitionId))) {
                Operation operation = new EvictOperation(mapName, key, true);
                try {
                    Future f = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
                    futures.add(f);
                } catch (Throwable t) {
                    logger.warning(t);
                }
            }
        }
        for (Future future : futures) {
            try {
                future.get(30, TimeUnit.SECONDS);
            } catch (TimeoutException e) {
                logger.finest(e);
            } catch (Exception e) {
                logger.warning(e);
            }
        }
    }
View Full Code Here

                    }
                });
            }
            esStats.submit(new Runnable() {
                public void run() {
                    final ILogger logger = hazelcast.getLoggingService().getLogger(hazelcast.getName());
                    while (running) {
                        try {
                            Thread.sleep(STATS_SECONDS * 1000);
                            int clusterSize = hazelcast.getCluster().getMembers().size();
                            Stats currentStats = stats.getAndReset();
                            logger.info("Cluster size: " + clusterSize + ", Operations per Second: "
                                    + (currentStats.total() / STATS_SECONDS));
                        } catch (HazelcastInstanceNotActiveException e) {
                            throw new RuntimeException(e);
                        } catch (Exception e) {
                            throw new RuntimeException(e);
View Full Code Here

        InternalPartitionImpl partition = partitionService.getPartition(partitionId);
        Address owner = partition.getOwner();
        long[] replicaVersions = partitionService.getPartitionReplicaVersions(partitionId);
        long currentVersion = replicaVersions[replicaIndex - 1];

        ILogger logger = getLogger();

        if (!nodeEngine.getThisAddress().equals(owner)) {
            if (logger.isFinestEnabled()) {
                logger.finest("Wrong target! " + toString() + " cannot be processed! Target should be: " + owner);
            }
            sendRetryResponse();
            return;
        }

        if (currentVersion == 0) {
            sendEmptyResponse();
            return;
        }

        if (!partitionService.incrementReplicaSyncProcessCount()) {
            if (logger.isFinestEnabled()) {
                logger.finest(
                        "Max parallel replication process limit exceeded! Could not run replica sync -> " + toString());
            }
            sendRetryResponse();
            return;
        }
View Full Code Here

    private void sendResponse(byte[] data) throws IOException {
        NodeEngine nodeEngine = getNodeEngine();

        ReplicaSyncResponse syncResponse = createResponse(data);
        Address target = getCallerAddress();
        ILogger logger = getLogger();
        if (logger.isFinestEnabled()) {
            logger.finest("Sending sync response to -> " + target + " for partition: "
                    + getPartitionId() + ", replica: " + getReplicaIndex());
        }
        OperationService operationService = nodeEngine.getOperationService();
        operationService.send(syncResponse, target);
    }
View Full Code Here

        return syncResponse;
    }

    private void logNoReplicaDataFound(int partitionId, int replicaIndex) {
        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
        ILogger logger = nodeEngine.getLogger(getClass());

        if (logger.isFinestEnabled()) {
            logger.finest("No replica data is found for partition: " + partitionId + ", replica: " + replicaIndex);
        }
    }
View Full Code Here

        }
        getEndpoint().sendResponse(result, getCallId());
    }

    private void logException(Exception e) {
        ILogger logger = getClientEngine().getLogger(CancellationRequest.class);
        logger.warning(e);
    }
View Full Code Here

        final int partitionId = getPartitionId();
        final InternalPartition partition = nodeEngine.getPartitionService().getPartition(partitionId);
        final Address owner = partition.getReplicaAddress(getReplicaIndex());
        if (!nodeEngine.getThisAddress().equals(owner)) {
            valid = false;
            final ILogger logger = getLogger();
            if (logger.isFinestEnabled()) {
                logger.finest("Wrong target! " + toString() + " cannot be processed! Target should be: " + owner);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.logging.ILogger

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.