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

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

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

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());
}
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 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());
}
com.netflix.hollow.api.producer.enforcerBasicSingleProducerEnforceronCycleStart

Popular methods of BasicSingleProducerEnforcer

  • <init>
  • disable
  • enable
  • isPrimary
  • onCycleComplete

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Notification (javax.management)
  • Reference (javax.naming)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top PhpStorm plugins
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