Package ch.ethz.vs.rowa.job

Examples of ch.ethz.vs.rowa.job.ClientRequests


  public String[][] executeQuery(UUID uuid, QueryFuture qf,
      String sql)
  {
    QueryJob queryJob = new QueryJob(uuid,this,sql,qf);
    synchronized(waitingJobList){
      ClientRequests crequest = waitingJobList.get(uuid);
      //System.out.println("execute query -> clientRequest: "+crequest.isRunning());
      synchronized (crequest) {
        if(crequest.isRunning()){
          crequest.addJob(queryJob);
        } else{
          synchronized(jobList){
            System.out.println("ADD QUERY job for UUID: "+uuid.toString());
            jobList.add(queryJob);
            crequest.setRunning();
            jobList.notifyAll();
          }
        }
        crequest.notifyAll();
      }
      waitingJobList.notifyAll();
    }
    return null;
  }
View Full Code Here


   */
  public void addWaitingJob(UUID uuid){
   
    Job job;
    synchronized (waitingJobList) {
      ClientRequests crequest = waitingJobList.get(uuid);
      //System.out.println("addwaitingjob -> "+crequest.getSizeOfJob());
      if(crequest.getSizeOfJob() > 0){
       
        job = crequest.removeJob();
        if(job != null){
          synchronized (jobList) {
            jobList.add(job);
            crequest.setRunning();
            jobList.notifyAll();
          }
        }
        else{
          crequest.setNotRunning();
        }
      }
      else{
        crequest.setNotRunning();
      }
      waitingJobList.notifyAll();
    }
  }
View Full Code Here

TOP

Related Classes of ch.ethz.vs.rowa.job.ClientRequests

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.