javax.media.jai.JAI.getTileScheduler()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中javax.media.jai.JAI.getTileScheduler()方法的一些代码示例,展示了JAI.getTileScheduler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JAI.getTileScheduler()方法的具体详情如下:
包路径:javax.media.jai.JAI
类名称:JAI
方法名:getTileScheduler

JAI.getTileScheduler介绍

暂无

代码示例

代码示例来源:origin: geoserver/geoserver

jaiDef.getTileScheduler().setParallelism(jai.getTileThreads());
jaiDef.getTileScheduler().setPrefetchParallelism(jai.getTileThreads());
jaiDef.getTileScheduler().setPriority(jai.getTilePriority());
jaiDef.getTileScheduler().setPrefetchPriority(jai.getTilePriority());

代码示例来源:origin: bcdev/beam

public OperatorExecutor(PlanarImage[] images, int tileCountX, int tileCountY, int parallelism) {
  this.images = images;
  this.tileCountX = tileCountX;
  this.tileCountY = tileCountY;
  this.parallelism = parallelism;
  this.tileScheduler = JAI.getDefaultInstance().getTileScheduler();
}

代码示例来源:origin: bcdev/beam

public OperatorExecutor(PlanarImage[] images, int tileCountX, int tileCountY) {
  this(images, tileCountX, tileCountY, JAI.getDefaultInstance().getTileScheduler().getParallelism());
}

代码示例来源:origin: bcdev/beam

private static void initJAI(ClassLoader cl) {
  // Suppress ugly (and harmless) JAI error messages saying that a JAI is going to continue in pure Java mode.
  System.setProperty("com.sun.media.jai.disableMediaLib", "true");  // disable native libraries for JAI
  // Must use a new operation registry in order to register JAI operators defined in Ceres and BEAM
  OperationRegistry operationRegistry = OperationRegistry.getThreadSafeOperationRegistry();
  InputStream is = SystemUtils.class.getResourceAsStream(JAI_REGISTRY_PATH);
  if (is != null) {
    // Suppress ugly (and harmless) JAI error messages saying that a descriptor is already registered.
    final PrintStream oldErr = System.err;
    try {
      setSystemErr(new PrintStream(new ByteArrayOutputStream()));
      operationRegistry.updateFromStream(is);
      operationRegistry.registerServices(cl);
      JAI.getDefaultInstance().setOperationRegistry(operationRegistry);
    } catch (IOException e) {
      BeamLogManager.getSystemLogger().log(Level.SEVERE,
                         MessageFormat.format("Error loading {0}: {1}", JAI_REGISTRY_PATH,
                                   e.getMessage()), e);
    } finally {
      setSystemErr(oldErr);
    }
  } else {
    BeamLogManager.getSystemLogger().warning(MessageFormat.format("{0} not found", JAI_REGISTRY_PATH));
  }
  Integer parallelism = Integer.getInteger(BEAM_PARALLELISM_PROPERTY_NAME,
                       Runtime.getRuntime().availableProcessors());
  JAI.getDefaultInstance().getTileScheduler().setParallelism(parallelism);
  BeamLogManager.getSystemLogger().info(
      MessageFormat.format("JAI tile scheduler parallelism set to {0}", parallelism));
}

代码示例来源:origin: org.geoserver.web/web-core

values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
values.put(KEY_JAI_TILE_THREAD_PRIORITY, Integer.toString(jai.getTileScheduler()
    .getPriority()));

代码示例来源:origin: org.geoserver.web/gs-web-core

KEY_JAI_MEM_THRESHOLD,
    Integer.toString((int) (100.0f * jaiCache.getMemoryThreshold())) + "%");
values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
values.put(
    KEY_JAI_TILE_THREAD_PRIORITY,
    Integer.toString(jai.getTileScheduler().getPriority()));

代码示例来源:origin: it.geosolutions.imageio-ext/imageio-ext-turbojpeg

final int minTy = ri.getMinTileY();
int TH = multithreadingLevel;
final TileScheduler ts = JAI.getDefaultInstance().getTileScheduler();
final List<Point> tiles = new ArrayList<Point>();
final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
  final int minTx = ri.getMinTileX();
  final int minTy = ri.getMinTileY();
  TileScheduler ts = JAI.getDefaultInstance().getTileScheduler();
  List<Point> tiles = new ArrayList<Point>();
  int tx = 0;

代码示例来源:origin: bcdev/beam

private void initializeJAI() {
  long tileCacheCapacity = commandLineArgs.getTileCacheCapacity();
  int tileSchedulerParallelism = commandLineArgs.getTileSchedulerParallelism();
  if (tileCacheCapacity > 0) {
    JAI.enableDefaultTileCache();
    JAI.getDefaultInstance().getTileCache().setMemoryCapacity(tileCacheCapacity);
  } else {
    JAI.getDefaultInstance().getTileCache().setMemoryCapacity(0L);
    JAI.disableDefaultTileCache();
  }
  if (tileSchedulerParallelism > 0) {
    JAI.getDefaultInstance().getTileScheduler().setParallelism(tileSchedulerParallelism);
  }
  final long tileCacheSize = JAI.getDefaultInstance().getTileCache().getMemoryCapacity() / (1024L * 1024L);
  commandLineContext.getLogger().info(MessageFormat.format("JAI tile cache size is {0} MB", tileCacheSize));
  final int schedulerParallelism = JAI.getDefaultInstance().getTileScheduler().getParallelism();
  commandLineContext.getLogger().info(
      MessageFormat.format("JAI tile scheduler parallelism is {0}", schedulerParallelism));
}

代码示例来源:origin: bcdev/beam

int parallelism = Runtime.getRuntime().availableProcessors();
System.out.println("parallelism = " + parallelism);
JAI.getDefaultInstance().getTileScheduler().setParallelism(parallelism);
Dimension frameSize = getFrameSize();
int numXFrames = 1 + (product.getSceneRasterWidth() - 1) / frameSize.width;

代码示例来源:origin: bcdev/beam

@Override
protected void setUp() throws Exception {
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(algoSpi);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(writeSpi);
  outputFile = GlobalTestConfig.getBeamTestDataOutputFile("WriteOpTest/writtenProduct.dim");
  outputFile.getParentFile().mkdirs();
  TileScheduler tileScheduler = JAI.getDefaultInstance().getTileScheduler();
  oldParallelism = tileScheduler.getParallelism();
  tileScheduler.setParallelism(Runtime.getRuntime().availableProcessors());
}

代码示例来源:origin: it.geosolutions.jaiext.utilities/jt-utilities

((tscheduler == JAI.getDefaultInstance().getTileScheduler()) ? "<global>" : "<local>") + ", parallelism " + tscheduler.getParallelism() +
", priority " + tscheduler.getPriority());

代码示例来源:origin: bcdev/beam

private static void scheduleTiles(int sleepTime) {
  ImageLayout imageLayout = new ImageLayout();
  imageLayout.setTileWidth(512);
  imageLayout.setTileHeight(512);
  RenderedOp op = ConstantDescriptor.create(1024f, 1024f,
                       new Short[]{1},
                       new RenderingHints(JAI.KEY_IMAGE_LAYOUT, imageLayout));
  TileScheduler tileScheduler = JAI.getDefaultInstance().getTileScheduler();
  MyTileComputationListener listener = new MyTileComputationListener();
  for (int i = 0; i < 1000; i++) {
    tileScheduler.scheduleTiles(op,
                  new Point[]{
                      new Point(0, 0)
                  },
                  new TileComputationListener[]{
                      listener
                  });
    if (sleepTime > 0) {
      sleep(sleepTime);
    }
  }
  sleep(100);
  System.out.println("scheduleTiles(sleepTime = " + sleepTime + "):");
  System.out.println("  Tiles computed: " + listener.computed);
  System.out.println("  Tiles cancelled: " + listener.cancelled);
  System.out.println("  Tile computation failures: " + listener.computationFailures);
}

代码示例来源:origin: geosolutions-it/jai-ext

((tscheduler == JAI.getDefaultInstance().getTileScheduler()) ? "<global>" : "<local>") + ", parallelism " + tscheduler.getParallelism() +
", priority " + tscheduler.getPriority());

代码示例来源:origin: bcdev/beam

@Before
public void setUp() throws Exception {
  defaultTileScheduler = JAI.getDefaultInstance().getTileScheduler();
  recordingTileScheduler = new RecordingTileScheduler(defaultTileScheduler);
  JAI.getDefaultInstance().setTileScheduler(recordingTileScheduler);
}

代码示例来源:origin: bcdev/beam

@Override
protected void tearDown() throws Exception {
  GPF.getDefaultInstance().getOperatorSpiRegistry().removeOperatorSpi(algoSpi);
  GPF.getDefaultInstance().getOperatorSpiRegistry().removeOperatorSpi(writeSpi);
  File parentFile = outputFile.getParentFile();
  FileUtils.deleteTree(parentFile);
  TileScheduler tileScheduler = JAI.getDefaultInstance().getTileScheduler();
  tileScheduler.setParallelism(oldParallelism);
}

代码示例来源:origin: bcdev/beam

@Override
protected void setUp() throws Exception {
  context = new GraphCommandLineContext();
  clTool = new CommandLineTool(context);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OP2_SPI);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OP3_SPI);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OUTPUT_OP_SPI);
  JAI jai = JAI.getDefaultInstance();
  jaiTileScheduler = jai.getTileScheduler();
  SunTileScheduler tileScheduler = new SunTileScheduler();
  tileScheduler.setParallelism(Runtime.getRuntime().availableProcessors());
  jai.setTileScheduler(tileScheduler);
}

代码示例来源:origin: bcdev/beam

JAI.getDefaultInstance().setImagingListener(new GPFImagingListener());
final TileScheduler tileScheduler = JAI.getDefaultInstance().getTileScheduler();
final int parallelism = tileScheduler.getParallelism();
final Semaphore semaphore = new Semaphore(parallelism, true);

代码示例来源:origin: geosolutions-it/jai-ext

JAI.getDefaultInstance().getTileScheduler().setParallelism(10);

代码示例来源:origin: bcdev/beam

@Before
public void setUp() throws Exception {
  context = new OpCommandLineContext();
  clTool = new CommandLineTool(context);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OP3_SPI);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OP4_SPI);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OP5_SPI);
  GPF.getDefaultInstance().getOperatorSpiRegistry().addOperatorSpi(OUTPUT_OP_SPI);
  JAI jai = JAI.getDefaultInstance();
  jaiTileScheduler = jai.getTileScheduler();
  SunTileScheduler tileScheduler = new SunTileScheduler();
  tileScheduler.setParallelism(Runtime.getRuntime().availableProcessors());
  jai.setTileScheduler(tileScheduler);
}

代码示例来源:origin: geosolutions-it/jai-ext

JAI.getDefaultInstance().getTileScheduler().setParallelism(1);

相关文章