APISonar


io.aeron.cluster.client.ClusterClock.time

> io > aeron > cluster > client > ClusterClock > time
io APIs aeron APIs cluster APIs client APIs ClusterClock APIs time APIs

Example 1
private final ClusterClock clusterClock;

    private boolean appendAction(final ClusterAction action)
    {
        return logPublisher.appendClusterAction(leadershipTermId, clusterClock.time(), action);
    }
Example 2
private final ClusterClock clusterClock;

    private void appendSessionOpen(final ClusterSession session)
    {
        final long resultingPosition = logPublisher.appendSessionOpen(session, leadershipTermId, clusterClock.time());
        if (resultingPosition > 0)
        {
            session.open(resultingPosition);
        }
    }
Example 3
private final ClusterClock clusterClock;

    public void onSessionClose(final long leadershipTermId, final long clusterSessionId)
    {
        final ClusterSession session = sessionByIdMap.get(clusterSessionId);
        if (leadershipTermId == this.leadershipTermId && null != session && Cluster.Role.LEADER == role)
        {
            session.close(CloseReason.CLIENT_ACTION);

            if (logPublisher.appendSessionClose(session, leadershipTermId, clusterClock.time()))
            {
                sessionByIdMap.remove(clusterSessionId);
            }
        }
    }
Example 4
private final ClusterClock clusterClock;

    public boolean onTimerEvent(final long correlationId)
    {
        final long appendPosition = logPublisher.appendTimer(correlationId, leadershipTermId, clusterClock.time());
        if (appendPosition > 0)
        {
            uncommittedTimers.offerLong(appendPosition);
            uncommittedTimers.offerLong(correlationId);
            return true;
        }

        return false;
    }
Example 5
private final ClusterClock clusterClock;

    public void onRequestVote(
        final long logLeadershipTermId, final long logPosition, final long candidateTermId, final int candidateId)
    {
        if (null != election)
        {
            election.onRequestVote(logLeadershipTermId, logPosition, candidateTermId, candidateId);
        }
        else if (candidateTermId > leadershipTermId)
        {
            ctx.countedErrorHandler().onError(new ClusterException(
                "unexpected vote request", AeronException.Category.WARN));
            enterElection(clusterTimeUnit.toNanos(clusterClock.time()));
            election.onRequestVote(logLeadershipTermId, logPosition, candidateTermId, candidateId);
        }
    }