Package org.apache.sling.event.impl.jobs.config

Examples of org.apache.sling.event.impl.jobs.config.TopologyCapabilities


        // check for unique jobs
        if ( jobName != null && !this.lock(jobTopic, jobName) ) {
            logger.debug("Discarding duplicate job {}", Utility.toString(jobTopic, jobName, jobProperties));
            return null;
        } else {
            final TopologyCapabilities caps = this.configuration.getTopologyCapabilities();
            info.targetId = (caps == null ? null : caps.detectTarget(jobTopic, jobProperties, info));

            if ( logger.isDebugEnabled() ) {
                if ( info.targetId != null ) {
                    logger.debug("Persisting job {} into queue {}, target={}", new Object[] {Utility.toString(jobTopic, jobName, jobProperties), info.queueName, info.targetId});
                } else {
View Full Code Here


        pw.printf("Average Processing Time : %s%n", formatTime(s.getAverageProcessingTime()));
        pw.printf("Average Waiting Time : %s%n", formatTime(s.getAverageWaitingTime()));
        pw.println();

        pw.println("Topology Capabilities");
        final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
        if ( cap == null ) {
            pw.print("No topology information available !");
        } else {
            final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
            for(final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
                final StringBuilder sb = new StringBuilder();
                for(final InstanceDescription id : entry.getValue()) {
                    if ( sb.length() > 0 ) {
                        sb.append(", ");
View Full Code Here

        pw.printf("    \"averageProcessingTimeText\" : \"%s\",%n", formatTime(s.getAverageProcessingTime()));
        pw.printf("    \"averageWaitingTime\" : %s,%n", s.getAverageWaitingTime());
        pw.printf("    \"averageWaitingTimeText\" : \"%s\"%n", formatTime(s.getAverageWaitingTime()));
        pw.print("  }");

        final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
        if ( cap != null ) {
            pw.println(",");
            pw.println("  \"capabilities\" : [");
            final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
            final Iterator<Map.Entry<String, List<InstanceDescription>>> iter = instanceCaps.entrySet().iterator();
            while ( iter.hasNext() ) {
                final Map.Entry<String, List<InstanceDescription>> entry = iter.next();
                final List<String> instances = new ArrayList<String>();
                for(final InstanceDescription id : entry.getValue()) {
View Full Code Here

        pw.println("</tbody></table>");
        pw.println("<br/>");

        pw.println("<table class='nicetable'><tbody>");
        pw.println("<tr><th colspan='2'>Topology Capabilities</th></tr>");
        final TopologyCapabilities cap = this.configuration.getTopologyCapabilities();
        if ( cap == null ) {
            pw.print("<tr><td colspan='2'>No topology information available !</td></tr>");
        } else {
            final Map<String, List<InstanceDescription>> instanceCaps = cap.getInstanceCapabilities();
            for(final Map.Entry<String, List<InstanceDescription>> entry : instanceCaps.entrySet()) {
                final StringBuilder sb = new StringBuilder();
                for(final InstanceDescription id : entry.getValue()) {
                    if ( sb.length() > 0 ) {
                        sb.append("<br/>");
View Full Code Here

     */
    public void run() {
        this.schedulerRuns++;
        logger.debug("Job manager maintenance: Starting #{}", this.schedulerRuns);

        final TopologyCapabilities topologyCapabilities = configuration.getTopologyCapabilities();
        if ( topologyCapabilities != null ) {
            // Clean up
            final String cleanUpUnassignedPath;;
            if ( topologyCapabilities.isLeader() ) {
                cleanUpUnassignedPath = this.configuration.getUnassignedJobsPath();
            } else {
                cleanUpUnassignedPath = null;
            }

View Full Code Here

     * Reassign to a new instance.
     */
    public void reassign() {
        final QueueInfo queueInfo = this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
        // Sanity check if queue configuration has changed
        final TopologyCapabilities caps = this.configuration.getTopologyCapabilities();
        final String targetId = (caps == null ? null : caps.detectTarget(job.getTopic(), job.getProperties(), queueInfo));

        final ResourceResolver resolver = this.configuration.createResourceResolver();
        try {
            final Resource jobResource = resolver.getResource(job.getResourcePath());
            if ( jobResource != null ) {
View Full Code Here

TOP

Related Classes of org.apache.sling.event.impl.jobs.config.TopologyCapabilities

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.