congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ExtendedLatch.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.dremio.common.concurrent.ExtendedLatch
constructor

Best Java code snippets using com.dremio.common.concurrent.ExtendedLatch.<init> (Showing top 8 results out of 315)

origin: dremio/dremio-oss

@Override
public void initialize(final int count) {
 Preconditions.checkArgument(latch == null, "Latch can be initialized only once at %s in %s.", desc,
  siteClass.getSimpleName());
 Preconditions.checkArgument(count > 0, "Count has to be a positive integer at %s in %s.", desc,
  siteClass.getSimpleName());
 latch = new ExtendedLatch(count);
}
origin: dremio/dremio-oss

/**
 * Waits until it is safe to exit. Blocks until all currently running fragments have completed.
 *
 * <p>This is intended to be used by {@link com.dremio.exec.server.SabotNode#close()}.</p>
 */
public void waitToExit() {
 synchronized(this) {
  if (externalIdToForeman.isEmpty()) {
   return;
  }
  exitLatch = new ExtendedLatch();
 }
 // Wait for at most 5 seconds or until the latch is released.
 exitLatch.awaitUninterruptibly(5000);
}
origin: dremio/dremio-oss

/**
 * Waits until it is safe to exit. Blocks until all currently running fragments have completed.
 *
 * <p>This is intended to be used by {@link com.dremio.exec.server.SabotNode#close()}.</p>
 */
public void waitToExit() {
 synchronized(this) {
  if (fragmentExecutors == null || fragmentExecutors.size() == 0) {
   return;
  }
  exitLatch = new ExtendedLatch();
 }
 // Wait for at most 5 seconds or until the latch is released.
 exitLatch.awaitUninterruptibly(5000);
}
origin: dremio/dremio-oss

}else{
 parallelism = Math.min(parallelism,  runnables.size());
 final ExtendedLatch latch = new ExtendedLatch(runnables.size());
 final ExecutorService threadPool = Executors.newFixedThreadPool(parallelism);
 try{
origin: dremio/dremio-oss

final ExtendedLatch endpointLatch = new ExtendedLatch(numIntFragments);
final FragmentSubmitFailures fragmentSubmitFailures = new FragmentSubmitFailures();
origin: dremio/dremio-oss

@Test
public void pauseInjected() {
 final long expectedDuration = 1000L;
 final ExtendedLatch trigger = new ExtendedLatch(1);
 final Pointer<Exception> ex = new Pointer<>();
 final String controls = Controls.newBuilder()
  .addPause(DummyClass.class, DummyClass.PAUSES)
  .build();
 ControlsInjectionUtil.setControls(session, controls);
 final QueryContext queryContext = new QueryContext(session, nodes[0].getContext(), QueryId.getDefaultInstance());
 (new ResumingThread(queryContext, trigger, ex, expectedDuration)).start();
 // test that the pause happens
 final DummyClass dummyClass = new DummyClass(queryContext, trigger);
 final long actualDuration = dummyClass.pauses();
 assertTrue(String.format("Test should stop for at least %d milliseconds.", expectedDuration),
  expectedDuration <= actualDuration);
 assertTrue("No exception should be thrown.", ex.value == null);
 try {
  queryContext.close();
 } catch (final Exception e) {
  fail("Failed to close query context: " + e);
 }
}
origin: dremio/dremio-oss

final ExtendedLatch trigger = new ExtendedLatch(1);
final Pointer<Exception> ex = new Pointer<>();
final QueryContext queryContext = new QueryContext(session, nodeContext1, QueryId.getDefaultInstance());
final ExtendedLatch trigger = new ExtendedLatch(1);
final QueryContext queryContext = new QueryContext(session, nodeContext2, QueryId.getDefaultInstance());
origin: dremio/dremio-oss

final ExtendedLatch trigger = new ExtendedLatch(1);
final Pointer<Long> countingDownTime = new Pointer<>();
com.dremio.common.concurrentExtendedLatch<init>

Popular methods of ExtendedLatch

  • await
  • awaitUninterruptibly
    Await without interruption for a given time.
  • countDown
  • getCount

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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