org.apache.ignite.Ignition.state()方法的使用及代码示例

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

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

Ignition.state介绍

[英]Gets state of grid default grid.
[中]获取网格默认网格的状态。

代码示例

代码示例来源:origin: apache/ignite

  1. @Override public boolean apply() {
  2. return IgniteState.STOPPED_ON_SEGMENTATION == Ignition.state(ignite.name());
  3. }
  4. }, 5000);

代码示例来源:origin: apache/ignite

  1. @Override public boolean apply() {
  2. return Ignition.state(slowClient.name()) == IgniteState.STOPPED_ON_SEGMENTATION;
  3. }
  4. }, getTestTimeout());

代码示例来源:origin: apache/ignite

  1. /**
  2. * Creates instance of the HadoopIgfsInProcWithIgniteRefsCount by IGFS name.
  3. *
  4. * @param ignite Ignite instance.
  5. * @param igfsName Target IGFS name.
  6. * @param log Log.
  7. * @param userName User name.
  8. * @return HadoopIgfsInProcWithIgniteRefsCount instance. {@code null} if the IGFS not found
  9. * in the specified ignite instance.
  10. */
  11. private static HadoopIgfsInProc create0(Ignite ignite, String igfsName, Log log, String userName) {
  12. assert Thread.holdsLock(REF_CTR_MUX);
  13. assert ignite != null;
  14. if (Ignition.state(ignite.name()) == STARTED) {
  15. try {
  16. for (IgniteFileSystem fs : ignite.fileSystems()) {
  17. if (F.eq(fs.name(), igfsName)) {
  18. Integer ctr = REF_CTRS.get(ignite.name());
  19. if (ctr != null)
  20. REF_CTRS.put(ignite.name(), ctr + 1);
  21. return new HadoopIgfsInProc((IgfsEx)fs, log, userName);
  22. }
  23. }
  24. }
  25. catch (IllegalStateException ignore) {
  26. // May happen if the grid state has changed:
  27. }
  28. }
  29. return null;
  30. }

代码示例来源:origin: apache/ignite

  1. /**
  2. * @throws Exception If failed.
  3. */
  4. @Override protected void beforeTest() throws Exception {
  5. for (int i = 0; i < GRID_CNT; i++) {
  6. if (Ignition.state(IGNITEs.get(i).name()) == STOPPED) {
  7. info("Restarting grid: " + i);
  8. IGNITEs.set(i, startGrid(i));
  9. }
  10. assert !jcache(i).isLocalLocked(KEY, false) : "Entry is locked for grid [idx=" + i + ']';
  11. }
  12. }

代码示例来源:origin: apache/ignite

  1. /**
  2. * @param ignite Ignite.
  3. * @throws Exception If failed.
  4. */
  5. private void waitSegmented(final Ignite ignite) throws Exception {
  6. GridTestUtils.waitForCondition(new GridAbsPredicate() {
  7. @Override public boolean apply() {
  8. return IgniteState.STOPPED_ON_SEGMENTATION == Ignition.state(ignite.name());
  9. }
  10. }, 5000);
  11. assertEquals(IgniteState.STOPPED_ON_SEGMENTATION, Ignition.state(ignite.name()));
  12. }

代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-ignite

  1. private <K, V> IgniteCache<K, V> getCache(String entityCacheName, boolean keepBinary) {
  2. IgniteCache<K, V> cache = null;
  3. try {
  4. cache = cacheManager.cache( entityCacheName );
  5. }
  6. catch (IllegalStateException ex) {
  7. if ( Ignition.state( gridName ) == IgniteState.STOPPED ) {
  8. log.stoppedIgnite();
  9. restart();
  10. cache = cacheManager.cache( entityCacheName );
  11. }
  12. else {
  13. throw ex;
  14. }
  15. }
  16. if ( cache == null ) {
  17. throw log.cacheNotFound( entityCacheName );
  18. }
  19. if ( keepBinary ) {
  20. cache = cache.withKeepBinary();
  21. }
  22. return cache;
  23. }

相关文章