Examples of SyncRequest


Examples of com.sun.enterprise.util.cluster.SyncRequest

    /**
     * Return a SyncRequest with the mod times for all the
     * files in the specified directory.
     */
    private SyncRequest getModTimes(String dir, SyncLevel level) {
        SyncRequest sr = new SyncRequest();
        sr.instance = instanceName;
        sr.dir = dir;
        File fdir = new File(instanceDir, dir);
        if (!fdir.exists())
            return sr;
View Full Code Here

Examples of com.sun.enterprise.util.cluster.SyncRequest

        new LocalStringManagerImpl(SynchronizeFiles.class);

    public void execute(AdminCommandContext context) {
        ActionReport report = context.getActionReport();
        logger = context.getLogger();
        SyncRequest sr = null;
        try {
            /*
            try {
            BufferedInputStream in =
                new BufferedInputStream(new FileInputStream(fileList));
View Full Code Here

Examples of com.sun.enterprise.util.cluster.SyncRequest

        CommandException exc = null;
        try {
            /*
             * First, synchronize the config directory.
             */
            SyncRequest sr = getModTimes("config", SyncLevel.FILES);
            synchronizeFiles(sr);

            /*
             * Was domain.xml updated?
             * If not, we're all done.
             */
            if (domainXml.lastModified() == dtime) {
                logger.fine(Strings.get("Sync.alreadySynced"));
                syncState.delete();
                /*
                 * Note that we earlier marked the token for reuse.  It's OK
                 * to return immediately here with the DAS still willing to
                 * accept the same token again.  The token will expire and be
                 * cleaned up in a little while and it was never exposed in a
                 * way that could be intercepted and used illicitly.
                 */
                return true;
            }

            /*
             * Now synchronize the applications.
             */
            sr = getModTimes("applications", SyncLevel.DIRECTORY);
            synchronizeFiles(sr);

            /*
             * Did we get any archive files?  If so,
             * have to unzip them in the applications
             * directory.
             */
            File appsDir = new File(instanceDir, "applications");
            File archiveDir = new File(appsDir, "__internal");
            for (File adir : FileUtils.listFiles(archiveDir)) {
                File[] af = FileUtils.listFiles(adir);
                if (af.length != 1) {
                    logger.finer("IGNORING " + adir + ", # files " + af.length);
                    continue;
                }
                File archive = af[0];
                File appDir = new File(appsDir, adir.getName());
                logger.finer("UNZIP " + archive + " TO " + appDir);
                try {
                    expand(appDir, archive);
                } catch (Exception ex) { }
            }

            FileUtils.whack(archiveDir);

            /*
             * Next, the libraries.
             * We assume there's usually very few files in the
             * "lib" directory so we check them all individually.
             */
            sr = getModTimes("lib", SyncLevel.RECURSIVE);
            synchronizeFiles(sr);

            /*
             * Next, the docroot.
             * The docroot could be full of files, so we only check
             * one level.
             */
            sr = getModTimes("docroot", SyncLevel.DIRECTORY);
            synchronizeFiles(sr);

            /*
             * Check any subdirectories of the instance config directory.
             * We only expect one - the config-specific directory,
             * but since we don't have an easy way of knowing the
             * name of that directory, we include them all.  The
             * DAS will tell us to remove anything that shouldn't
             * be there.
             */
            sr = new SyncRequest();
            sr.instance = instanceName;
            sr.dir = "config-specific";
            File configDir = new File(instanceDir, "config");
            for (File f : configDir.listFiles()) {
                if (!f.isDirectory())
View Full Code Here

Examples of com.sun.enterprise.util.cluster.SyncRequest

    /**
     * Return a SyncRequest with the mod times for all the
     * files in the specified directory.
     */
    private SyncRequest getModTimes(String dir, SyncLevel level) {
        SyncRequest sr = new SyncRequest();
        sr.instance = instanceName;
        sr.dir = dir;
        File fdir = new File(instanceDir, dir);
        if (!fdir.exists())
            return sr;
View Full Code Here

Examples of net.kuujo.copycat.protocol.SyncRequest

   * Sends a sync request.
   */
  private void doSync(final long prevIndex, final CopycatEntry prevEntry, final List<CopycatEntry> entries) {
    final long commitIndex = state.commitIndex();

    SyncRequest request = new SyncRequest(state.nextCorrelationId(), state.currentTerm(), state.clusterManager().localNode().member().id(), prevIndex, prevEntry != null ? prevEntry.term() : 0, entries, commitIndex);

    sendIndex = Math.max(sendIndex + 1, prevIndex + entries.size() + 1);

    LOGGER.debug("{} - Sent {} to {}", state.clusterManager().localNode(), request, node);
    node.client().sync(request).whenComplete((response, error) -> {
View Full Code Here

Examples of org.apache.cassandra.repair.messages.SyncRequest

                CompactionManager.instance.submitValidation(store, validator);
                break;

            case SYNC_REQUEST:
                // forwarded sync request
                SyncRequest request = (SyncRequest) message.payload;
                StreamingRepairTask task = new StreamingRepairTask(desc, request);
                task.run();
                break;

            case ANTICOMPACTION_REQUEST:
View Full Code Here

Examples of org.apache.cassandra.repair.messages.SyncRequest

        InetAddress local = FBUtilities.getBroadcastAddress();
        // We can take anyone of the node as source or destination, however if one is localhost, we put at source to avoid a forwarding
        InetAddress src = r2.endpoint.equals(local) ? r2.endpoint : r1.endpoint;
        InetAddress dst = r2.endpoint.equals(local) ? r1.endpoint : r2.endpoint;

        SyncRequest request = new SyncRequest(desc, local, src, dst, differences);
        StreamingRepairTask task = new StreamingRepairTask(desc, request);
        task.run();
    }
View Full Code Here

Examples of org.apache.cassandra.repair.messages.SyncRequest

    }

    protected void startSync(List<Range<Token>> differences)
    {
        InetAddress local = FBUtilities.getBroadcastAddress();
        SyncRequest request = new SyncRequest(desc, local, r1.endpoint, r2.endpoint, differences);
        logger.info(String.format("[repair #%s] Forwarding streaming repair of %d ranges to %s (to be streamed with %s)", desc.sessionId, request.ranges.size(), request.src, request.dst));
        MessagingService.instance().sendOneWay(request.createMessage(), request.src);
    }
View Full Code Here

Examples of org.apache.cassandra.repair.messages.SyncRequest

        InetAddress local = FBUtilities.getBroadcastAddress();
        // We can take anyone of the node as source or destination, however if one is localhost, we put at source to avoid a forwarding
        InetAddress src = r2.endpoint.equals(local) ? r2.endpoint : r1.endpoint;
        InetAddress dst = r2.endpoint.equals(local) ? r1.endpoint : r2.endpoint;

        SyncRequest request = new SyncRequest(desc, local, src, dst, differences);
        StreamingRepairTask task = new StreamingRepairTask(desc, request);
        task.run();
    }
View Full Code Here

Examples of org.apache.cassandra.repair.messages.SyncRequest

                CompactionManager.instance.submitValidation(store, validator);
                break;

            case SYNC_REQUEST:
                // forwarded sync request
                SyncRequest request = (SyncRequest) message.payload;
                StreamingRepairTask task = new StreamingRepairTask(desc, request);
                task.run();
                break;

            default:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.