Package org.apache.flink.runtime.blob

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


    config.setLong(ConfigConstants.LIBRARY_CACHE_MANAGER_CLEANUP_INTERVAL, 1);
    GlobalConfiguration.includeConfiguration(config);

    JobID jid = new JobID();
    List<BlobKey> keys = new ArrayList<BlobKey>();
    BlobServer server = null;
    LibraryCacheManager libraryCacheManager = null;

    final byte[] buf = new byte[128];

    try {
      server = new BlobServer();
      InetSocketAddress blobSocketAddress = new InetSocketAddress(server.getServerPort());
      BlobClient bc = new BlobClient(blobSocketAddress);

      keys.add(bc.put(buf));
      buf[0] += 1;
      keys.add(bc.put(buf));

      libraryCacheManager = new BlobLibraryCacheManager(server, GlobalConfiguration.getConfiguration());
      libraryCacheManager.registerJob(jid, keys);

      List<File> files = new ArrayList<File>();

      for (BlobKey key: keys){
        files.add(libraryCacheManager.getFile(key));
      }

      assertEquals(2, files.size());
      files.clear();

      libraryCacheManager.unregisterJob(jid);

      Thread.sleep(1500);

      int caughtExceptions = 0;

      for (BlobKey key : keys) {
        // the blob cache should no longer contain the files
        try {
          files.add(libraryCacheManager.getFile(key));
        } catch (IOException ioe) {
          caughtExceptions++;
        }
      }

      assertEquals(2, caughtExceptions);
     
      bc.close();
    }
    catch(Exception e){
      e.printStackTrace();
      fail(e.getMessage());
    }
    finally{
      if (server != null){
        try {
          server.shutdown();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
View Full Code Here


        ConfigConstants.DEFAULT_JOB_MANAGER_DEAD_TASKMANAGER_TIMEOUT);
   
    // Load the job progress collector
    this.eventCollector = new EventCollector(this.recommendedClientPollingInterval);

    this.libraryCacheManager = new BlobLibraryCacheManager(new BlobServer(),
        GlobalConfiguration.getConfiguration());
   
    // Register simple job archive
    int archived_items = GlobalConfiguration.getInteger(
        ConfigConstants.JOB_MANAGER_WEB_ARCHIVE_COUNT, ConfigConstants.DEFAULT_JOB_MANAGER_WEB_ARCHIVE_COUNT);
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.blob.BlobServer

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.