Package com.sleepycat.je.rep

Examples of com.sleepycat.je.rep.ReplicationGroup


    /**
     * Notify the monitor about the group change (add/remove a node) event.
     */
    public ResponseMessage process(GroupChange groupChange) {
        GroupChangeEvent event =
            new GroupChangeEvent(new ReplicationGroup(groupChange.getGroup()),
                                 groupChange.getNodeName(),
                                 groupChange.getOpType());
        monitor.notifyGroupChange(event);
        return null;
    }
View Full Code Here


        masterChangeListener = new MasterChangeListener();
        learner.addListener(masterChangeListener);
        learner.start();
        try {
            /* Notify the listener about the current master. */
            final ReplicationGroup repGroup = repGroupAdmin.getGroup();
            final RepGroupImpl group = RepInternal.getRepGroupImpl(repGroup);

            /*
             * In the absence of a network failure, the query should result in
             * a call to the notify method of MonitorChangeListener.
View Full Code Here

         * Ping all nodes to find out about possible missed events.
         * Manufacture notifications for any missed events.
         */
        private void queryNodes() {
            /* Get the current valid group information. */
            ReplicationGroup repGroup = getValidGroup();

            /* Send missed REMOVE GroupChangeEvents. */
            for (ReplicationNode repNode : repGroup.getRemovedNodes()) {
                notifyGroupChange
                    (new GroupChangeEvent(repGroup,
                                          repNode.getName(),
                                          GroupChangeType.REMOVE));
            }

            /*
             * Send missed ADD GroupChangeEvents, JoinGroupEvent and
             * LeaveGroupEvent.
             */
            for (ReplicationNode repNode : repGroup.getElectableNodes()) {
                pingElectableNodes(repNode, repGroup);
            }
        }
View Full Code Here

        /*
         * If the master is currently unknown, use the last valid group
         * information so that the ping thread can continue working.
         */
        private ReplicationGroup getValidGroup() {
            ReplicationGroup repGroup = null;
            try {
                repGroup = getGroup();
                group = repGroup;
            } catch (Exception e) {
                repGroup = group;
View Full Code Here

               EnvironmentFailureException {

        GroupResponse resp = (GroupResponse) doMessageExchange
            (groupProtocol.new GroupRequest(), GroupResponse.class);

        return new ReplicationGroup(resp.getGroup());
    }
View Full Code Here

     */
    private void checkMember(String nodeName, String masterErrorMessage)
        throws MasterStateException,
               MemberNotFoundException {

        final ReplicationGroup group = getGroup();
        final RepNodeImpl node = (RepNodeImpl) group.getMember(nodeName);

        /* Check the membership. */
        if (node == null) {
            throw new MemberNotFoundException("Node: " + nodeName + " is " +
                                              " is not a member of the " +
View Full Code Here

        throws UnknownMasterException,
               MemberNotFoundException,
               MasterStateException,
               EnvironmentFailureException {

        final ReplicationGroup group = getGroup();
        final RepNodeImpl node = (RepNodeImpl) group.getMember(nodeName);

        if (node == null) {
            throw new MemberNotFoundException("Node:" + nodeName +
                                              "is not a member of the group:" +
                                              groupName);
View Full Code Here

         GroupService.SERVICE_NAME,
         groupProtocol.new GroupRequest());
        me.run();
        ResponseMessage resp = me.getResponseMessage();
        if (resp instanceof GroupResponse) {
            return new ReplicationGroup(((GroupResponse)resp).getGroup());
        }
        throw getException(resp);
    }
View Full Code Here

        return baos.toByteArray();
    }

    private void populateExistingRemoteReplicationNodes()
    {
        ReplicationGroup group = _environment.getGroup();
        Set<ReplicationNode> nodes = new HashSet<ReplicationNode>(group.getElectableNodes());
        String localNodeName = getNodeName();

        for (ReplicationNode replicationNode : nodes)
        {
            String discoveredNodeName = replicationNode.getName();
View Full Code Here

            String groupName = _configuration.getGroupName();
            ReplicatedEnvironment env = _environment;
            ReplicationGroupListener replicationGroupListener = _replicationGroupListener.get();
            if (env != null)
            {
                ReplicationGroup group = env.getGroup();
                Set<ReplicationNode> nodes = new HashSet<ReplicationNode>(group.getNodes());
                String localNodeName = getNodeName();

                Map<String, ReplicationNode> removalMap = new HashMap<String, ReplicationNode>(_remoteReplicationNodes);
                for (ReplicationNode replicationNode : nodes)
                {
View Full Code Here

TOP

Related Classes of com.sleepycat.je.rep.ReplicationGroup

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.