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

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

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

Ignite.active介绍

[英]Checks Ignite grid is active or not active.
[中]检查点火栅极是否激活。

代码示例

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

@Override public Boolean call() throws Exception {
    return ig.active();
  }
}

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

@Override public Boolean call() throws Exception {
    return ig.active();
  }
});

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

/** {@inheritDoc} */
@Override public void active(boolean active) {
  checkIgnite();
  g.active(active);
}

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

/** {@inheritDoc} */
@Override public boolean active() {
  checkIgnite();
  return g.active();
}

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

@Override public Void call() throws Exception {
    barrier.await();
    ig3C.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig1B.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig1C.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig1B.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig3B.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig2C.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig2B.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig2B.active(true);
    return null;
  }
});

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

@Override public Void call() throws Exception {
    barrier.await();
    ig3B.active(true);
    return null;
  }
});

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

/**
 * Starts and activates new grid with given index.
 *
 * @param idx Index of the grid to start.
 * @return Started and activated grid.
 * @throws Exception If anything failed.
 */
@NotNull private Ignite startActivateGrid(int idx) throws Exception {
  final Ignite ignite = startGrid(idx);
  ignite.active(true);
  return ignite;
}

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

/**
 *
 */
@NotNull private IgniteCache insertSomeData(Ignite ignite) {
  if (!ignite.active())
    ignite.active(true);
  IgniteCache<String, Person> cache = ignite.cache("cache");
  for (int i=0; i<10; i++)
    cache.put(String.valueOf(System.currentTimeMillis()), new Person("Name " + i, i));
  return cache;
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testSemaphoreVolatility() throws Exception {
  Ignite ignite = startGrids(4);
  ignite.active(true);
  IgniteSemaphore sem = ignite.semaphore("test", 10, false, true);
  assert sem != null;
  stopAllGrids();
  ignite = startGrids(4);
  ignite.active(true);
  sem = ignite.semaphore("test", 10, false, false);
  assert sem == null;
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testLatchVolatility() throws Exception {
  Ignite ignite = startGrids(4);
  ignite.active(true);
  IgniteCountDownLatch latch = ignite.countDownLatch("test", 10, false, true);
  assert latch != null;
  stopAllGrids();
  ignite = startGrids(4);
  ignite.active(true);
  latch = ignite.countDownLatch("test", 10, false, false);
  assert latch == null;
}

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

/** */
private Map<Integer, Integer> startGridsAndLoadData(int srvs) throws Exception {
  Ignite srv = startGrids(srvs);
  srv.active(true);
  srv.createCaches(Arrays.asList(cacheConfigurations1()));
  Map<Integer, Integer> cacheData = new LinkedHashMap<>();
  for (int i = 1; i <= 100; i++) {
    for (CacheConfiguration ccfg : cacheConfigurations1()) {
      srv.cache(ccfg.getName()).put(-i, i);
      cacheData.put(-i, i);
    }
  }
  return cacheData;
}

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

/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
  super.beforeTest();
  stopAllGrids();
  final Ignite crd = startGrid(DUMMY_GRID_NAME);
  crd.active(true);
  startGrid("client");
}

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

/**
 * @throws Exception If failed.
 */
@Test
public void testCreateDropCache() throws Exception {
  ccfgs = new CacheConfiguration[]{cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1)
    .setIndexedTypes(Integer.class, Person.class)};
  Ignite ignite = startGrid();
  ignite.active(true);
  ignite.cache("c1").destroy();
  stopGrid();
}

相关文章