public void registerNode(final CloudNode cloudNode) {
        Objects.requireNonNull(cloudNode, "The given cloud node must not be null.");

        final String nodeName = cloudNode.getName();
        final NodeRecord record = new NodeRecord(nodeName, Holder.INSTANCE.getMemberId());
        HazelcastHelper.getMap(ACTIVE_NODES).put(nodeName, record);
        HazelcastHelper.<NodeMessage>getTopic(nodeName).addMessageListener(cloudNode);
        Holder.INSTANCE.getInstance().getCluster().addMembershipListener(cloudNode);
        logger.info("The given node registered: {}", record);

        final Optional<NodeRecord> optional = this.getMasterNodeRecord();
        if (!optional.isPresent()) {
            this.setMaster(cloudNode);
            return;
        }

        logger.info("Found the master node: {}", optional.get());

        if (WORKING_MODE) {
            final Thread thread = new Thread(this.createConsumer(cloudNode));
            thread.start();
        }
    }