congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BasicSingleProducerEnforcer.isPrimary
Code IndexAdd Tabnine to your IDE (free)

How to use
isPrimary
method
in
com.netflix.hollow.api.producer.enforcer.BasicSingleProducerEnforcer

Best Java code snippets using com.netflix.hollow.api.producer.enforcer.BasicSingleProducerEnforcer.isPrimary (Showing top 4 results out of 315)

origin: Netflix/hollow

@Test
public void testEnableDisable() {
  BasicSingleProducerEnforcer se = new BasicSingleProducerEnforcer();
  Assert.assertTrue(se.isPrimary());
  se.disable();
  Assert.assertFalse(se.isPrimary());
  se.enable();
  Assert.assertTrue(se.isPrimary());
}
origin: Netflix/hollow

@Test
public void testTransitions() {
  BasicSingleProducerEnforcer se = new BasicSingleProducerEnforcer();
  Assert.assertTrue(se.isPrimary());
  se.onCycleStart(1234L);
  Assert.assertTrue(se.isPrimary());
  se.disable();
  Assert.assertTrue(se.isPrimary());
  se.onCycleComplete(null, 10L, TimeUnit.SECONDS);
  Assert.assertFalse(se.isPrimary());
  se.enable();
  Assert.assertTrue(se.isPrimary());
  se.onCycleStart(1235L);
  Assert.assertTrue(se.isPrimary());
  se.disable();
  Assert.assertTrue(se.isPrimary());
  se.onCycleComplete(null, 10L, TimeUnit.SECONDS);
  Assert.assertFalse(se.isPrimary());
}
origin: Netflix/hollow

@Test
public void testMultiCycle() {
  BasicSingleProducerEnforcer se = new BasicSingleProducerEnforcer();
  for (int i = 0; i < 10; i++) {
    se.enable();
    Assert.assertTrue(se.isPrimary());
    se.onCycleStart(1234L);
    se.disable();
    Assert.assertTrue(se.isPrimary());
    se.onCycleComplete(null, 10L, TimeUnit.SECONDS);
    Assert.assertFalse(se.isPrimary());
  }
}
origin: Netflix/hollow

@Test
public void testEnabledDisabledCyle() {
  BasicSingleProducerEnforcer se = new BasicSingleProducerEnforcer();
  Assert.assertTrue(se.isPrimary());
  se.onCycleStart(1234L);
  se.onCycleComplete(null, 10L, TimeUnit.SECONDS);
  se.disable();
  Assert.assertFalse(se.isPrimary());
}
com.netflix.hollow.api.producer.enforcerBasicSingleProducerEnforcerisPrimary

Popular methods of BasicSingleProducerEnforcer

  • <init>
  • disable
  • enable
  • onCycleComplete
  • onCycleStart

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now