Examples of BlobCache


Examples of org.apache.flink.runtime.blob.BlobCache

      } else {
        final InetSocketAddress blobServerAddress = new InetSocketAddress(
          jobManagerAddress.getAddress(), blobPort);
        LOG.info("Determined BLOB server address to be " + blobServerAddress);

        this.libraryCacheManager = new BlobLibraryCacheManager(new BlobCache
            (blobServerAddress), GlobalConfiguration.getConfiguration());
      }
    }
    this.ioManager = new IOManager(tmpDirPaths);
   
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

    if (rawUrl != null && rawUrl.startsWith("file://")) {
      try {
        URI uri = new URI(rawUrl);
        File localFile = new File(uri);

        BlobCache cache = BlobCache.getInstance(event.getCompute(), event.getClusterSpec());
        cache.putIfAbsent(localFile);

        final String basePath = "/tmp/whirr/cache/files/";
        addStatement(event, cache.getAsSaveToStatement(basePath, uri));
        return "file://" + basePath + localFile.getName();

      } catch (URISyntaxException e) {
        throw new IOException(e);
      }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

    if (rawUrl != null && rawUrl.startsWith("file://")) {
      try {
        URI uri = new URI(rawUrl);
        File localFile = new File(uri);

        BlobCache cache = BlobCache.getInstance(event.getCompute(), event.getClusterSpec());
        cache.putIfAbsent(localFile);

        final String basePath = "/tmp/whirr/cache/files/";
        addStatement(event, cache.getAsSaveToStatement(basePath, uri));
        return "file://" + basePath + localFile.getName();

      } catch (URISyntaxException e) {
        throw new IOException(e);
      }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

      return; // this test can be executed only on amazon but the internal
      // location selection mechanism should work for any cloud provider
    }
    spec.setTemplate(TemplateBuilderSpec.parse("locationId=eu-west-1"));

    BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);
    assertThat(cache.getLocation().getId(), is("EU"));
  }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

    LOG.info("Created temporary container '{}'", container);

    try {
      spec.setBlobStoreCacheContainer(container);

      BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);
      assertThat(cache.getContainer(), is(container));
      cache.dropAndClose();

      assertThat(context.getBlobStore().containerExists(container), is(true));

    } finally {
      LOG.info("Removing temporary container '{}'", container);
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

  private void testBlobCacheUpload(String payload, ClusterSpec spec)
      throws Exception {
    File tempFile = createTemporaryFile(payload);

    BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);

    try {
      cache.putIfAbsent(tempFile);

      HttpRequest req = cache.getSignedRequest(tempFile.getName());
      assertThat(readContent(req), is(payload));

      /* render download statement for visual test inspection */
      LOG.info(cache.getAsSaveToStatement("/tmp",
          tempFile.getName()).render(OsFamily.UNIX));

    } finally {
      BlobCache.dropAndCloseAll();
    }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

      throws IOException {
    if (rawUrl != null && rawUrl.startsWith("file://")) {
      try {
        URI uri = new URI(rawUrl);

        BlobCache cache = BlobCache.getInstance(event.getCompute(), event.getClusterSpec());
        cache.putIfAbsent(uri);

        String basePath = "/tmp/whirr/cache/files/";
        addStatement(event, cache.getAsSaveToStatement(basePath, uri));
        return "file://" + basePath + (new File(uri)).getName();

      } catch (URISyntaxException e) {
        throw new IOException(e);
      }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

  public void testUploadFileToBlobCache() throws Exception {
    String expected = "dummy content";
    File tempFile = createTemporaryFile(expected);

    ClusterSpec spec = getTestClusterSpec();
    BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);

    try {
      cache.putIfAbsent(tempFile);

      HttpRequest req = cache.getSignedRequest(tempFile.getName());
      assertThat(readContent(req), is(expected));

      /* render download statement for visual test inspection */
      LOG.info(cache.getAsSaveToStatement("/tmp",
          tempFile.getName()).render(OsFamily.UNIX));

    } finally {
      BlobCache.dropAndCloseAll();
    }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

      return; // this test can be executed only on amazon but the internal
      // location selection mechanism should work for any cloud provider
    }
    spec.setLocationId("eu-west-1");

    BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);
    assertThat(cache.getLocation().getId(), is("EU"));
  }
View Full Code Here

Examples of org.apache.whirr.util.BlobCache

    if (rawUrl != null && rawUrl.startsWith("file://")) {
      try {
        URI uri = new URI(rawUrl);
        File localFile = new File(uri);

        BlobCache cache = BlobCache.getInstance(event.getCompute(), event.getClusterSpec());
        cache.putIfAbsent(localFile);

        final String basePath = "/tmp/whirr/cache/files/";
        addStatement(event, cache.getAsSaveToStatement(basePath, uri));
        return "file://" + basePath + localFile.getName();

      } catch (URISyntaxException e) {
        throw new IOException(e);
      }
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.