Examples of JobMetadata


Examples of org.jclouds.glacier.domain.JobMetadata

   @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testInitiateJob"})
   public void testDescribeJob() {
      VaultMetadata vaultMetadata = api.describeVault(VAULT_NAME);

      JobMetadata archiveRetrievalMetadata = api.describeJob(VAULT_NAME, archiveRetrievalJob);
      assertThat(archiveRetrievalMetadata.getArchiveId()).isEqualTo(archiveId);
      assertThat(archiveRetrievalMetadata.getJobId()).isEqualTo(archiveRetrievalJob);
      assertThat(archiveRetrievalMetadata.getVaultArn()).isEqualTo(vaultMetadata.getVaultARN());

      JobMetadata inventoryRetrievalMetadata = api.describeJob(VAULT_NAME, inventoryRetrievalJob);
      assertThat(inventoryRetrievalMetadata.getJobId()).isEqualTo(inventoryRetrievalJob);
      assertThat(inventoryRetrievalMetadata.getVaultArn()).isEqualTo(vaultMetadata.getVaultARN());
   }
View Full Code Here

Examples of org.jclouds.glacier.domain.JobMetadata

   public BasePollingStrategy(GlacierClient client) {
      this(DEFAULT_INITIAL_WAIT, DEFAULT_TIME_BETWEEN_POLLS, client);
   }

   private boolean inProgress(String job, String vault) {
      JobMetadata jobMetadata = client.describeJob(vault, job);
      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.IN_PROGRESS);
   }
View Full Code Here

Examples of org.jclouds.glacier.domain.JobMetadata

         Thread.sleep(timeBetweenPolls);
      }
   }

   private boolean succeeded(String job, String vault) {
      JobMetadata jobMetadata = client.describeJob(vault, job);
      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.SUCCEEDED);
   }
View Full Code Here

Examples of org.jclouds.glacier.domain.JobMetadata

      mr.addHeader(HttpHeaders.CONTENT_TYPE, MediaType.JSON_UTF_8);
      mr.setBody(getResponseBody("/json/describeJobResponseBody.json"));
      mr.addHeader(HttpHeaders.CONTENT_LENGTH, mr.getBody().length);
      server.enqueue(mr);

      JobMetadata job = client.describeJob(VAULT_NAME, JOB_ID);
      assertThat(job.getAction()).isEqualTo("ArchiveRetrieval");
      assertThat(job.getArchiveId()).isEqualTo(ARCHIVE_ID);
      assertThat(ContentRange.fromString("0-16777215")).isEqualTo(job.getRetrievalByteRange());
      assertThat(job.getVaultArn()).isEqualTo("arn:aws:glacier:us-east-1:012345678901:vaults/examplevault");

      assertEquals(server.takeRequest().getRequestLine(), "GET /-/vaults/" + VAULT_NAME + "/jobs/" + JOB_ID + " " + HTTP);
   }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

    public GetJobResponse getJob(@PathVariable String jobId) throws NotFound {

        MetaGraphTx tx = metaGraphService.buildTransaction().readOnly().start();

        try {
            JobMetadata jobMetadata = tx.getJob(jobId);
            if (jobMetadata == null) {
                throw new NotFound(JobMetadata.class, jobId);
            }

            return new GetJobResponse(jobMetadata);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

    public DeleteJobResponse deleteJob(@PathVariable String jobId) throws NotFound {
        MetaGraphTx tx = metaGraphService.newTransaction();
        DeleteJobResponse deleteJobResponse;

        try {
            JobMetadata jobMetadata = tx.getJob(jobId);
            if (jobMetadata == null) {
                throw new NotFound(JobMetadata.class, jobId);
            }

            tx.deleteJob(jobMetadata);
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

            response.put("msg", "missing project metadata for graph '" + graphId + "'");
            tx.rollback();
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        JobMetadata jobMetadata = tx.createJob(projectMetadata);

        response.put("status", "ok");
        response.put("msg", "job submitted");
        response.put("jobId", jobMetadata.getId().toString());

        tx.commit();

        if (!algorithm.equals("approximate_diameter") &&
           !algorithm.equals("connected_component") &&
           !algorithm.equals("connected_component_stats") &&
           !algorithm.equals("directed_triangle_count") &&
           !algorithm.equals("eigen_vector_normalization") &&
           !algorithm.equals("graph_laplacian") &&
           !algorithm.equals("kcore") &&
           !algorithm.equals("pagerank") &&
           !algorithm.equals("partitioning") &&
           !algorithm.equals("simple_coloring") &&
           !algorithm.equals("simple_undirected_triangle_count") &&
           !algorithm.equals("sssp") &&
           !algorithm.equals("TSC") &&
           !algorithm.equals("undirected_triangle_count")) {
            response.put("status", "error");
            response.put("msg", algorithm + " not implemented");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        // We can't pass the values directly because they'll live in a separate thread.
        graphLabService.graphLabAlgorithm(graph, algorithm, jobMetadata.getId());

        return new ResponseEntity<>(response, HttpStatus.OK);
    }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

            response.put("msg", "missing project metadata for graph '" + graphId + "'");
            tx.rollback();
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        JobMetadata jobMetadata = tx.createJob(projectMetadata);

        response.put("status", "ok");
        response.put("msg", "job submitted");
        response.put("jobId", jobMetadata.getId().toString());

        tx.commit();

        // We can't pass the values directly because they'll live in a separate thread.
        edgeDegreesService.titanCountDegrees(graph, jobMetadata.getId());

        return new ResponseEntity<>(response, HttpStatus.OK);
    }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

            response.put("msg", "missing project metadata for graph '" + graphId + "'");
            tx.rollback();
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        JobMetadata jobMetadata = tx.createJob(projectMetadata);

        response.put("status", "ok");
        response.put("msg", "job submitted");
        response.put("jobId", jobMetadata.getId().toString());

        tx.commit();

        // We can't pass the values directly because they'll live in a separate thread.
        edgeDegreesService.faunusCountDegrees(graph, jobMetadata.getId());

        return new ResponseEntity<>(response, HttpStatus.OK);
    }
View Full Code Here

Examples of org.lab41.dendrite.metagraph.models.JobMetadata

            response.put("msg", "missing project metadata for graph '" + graphId + "'");
            tx.rollback();
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        JobMetadata jobMetadata = tx.createJob(projectMetadata);

        response.put("status", "ok");
        response.put("msg", "job submitted");
        response.put("jobId", jobMetadata.getId().toString());

        tx.commit();

        if (!algorithm.equals("centrality")) {
            response.put("status", "error");
            response.put("msg", algorithm + " not implemented");
            return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
        }

        // We can't pass the values directly because they'll live in a separate thread.
        snapService.snapAlgorithm(graph, algorithm, jobMetadata.getId());

        return new ResponseEntity<>(response, HttpStatus.OK);
    }
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.