Codota Logo
Threads.threadsNamed
Code IndexAdd Codota to your IDE (free)

How to use
threadsNamed
method
in
io.airlift.concurrent.Threads

Best Java code snippets using io.airlift.concurrent.Threads.threadsNamed (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: prestodb/presto

public TaskManagementExecutor()
{
  taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s"));
  taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor);
}
origin: prestodb/presto

public ClusterSizeMonitor(
    InternalNodeManager nodeManager,
    boolean includeCoordinator,
    int initializationMinCount,
    Duration initializationMaxWait,
    int executionMinCount,
    Duration executionMaxWait)
{
  this.nodeManager = requireNonNull(nodeManager, "nodeManager is null");
  this.includeCoordinator = includeCoordinator;
  checkArgument(initializationMinCount >= 0, "initializationMinCount is negative");
  this.initializationMinCount = initializationMinCount;
  this.initializationMaxWait = requireNonNull(initializationMaxWait, "initializationMaxWait is null");
  checkArgument(executionMinCount >= 0, "executionMinCount is negative");
  this.executionMinCount = executionMinCount;
  this.executionMaxWait = requireNonNull(executionMaxWait, "executionMaxWait is null");
  this.executor = newSingleThreadScheduledExecutor(threadsNamed("node-monitor-%s"));
}
origin: prestodb/presto

@VisibleForTesting
public TaskExecutor(
    int runnerThreads,
    int minDrivers,
    int guaranteedNumberOfDriversPerTask,
    int maximumNumberOfDriversPerTask,
    EmbedVersion embedVersion,
    MultilevelSplitQueue splitQueue,
    Ticker ticker)
{
  checkArgument(runnerThreads > 0, "runnerThreads must be at least 1");
  checkArgument(guaranteedNumberOfDriversPerTask > 0, "guaranteedNumberOfDriversPerTask must be at least 1");
  checkArgument(maximumNumberOfDriversPerTask > 0, "maximumNumberOfDriversPerTask must be at least 1");
  checkArgument(guaranteedNumberOfDriversPerTask <= maximumNumberOfDriversPerTask, "guaranteedNumberOfDriversPerTask cannot be greater than maximumNumberOfDriversPerTask");
  // we manage thread pool size directly, so create an unlimited pool
  this.executor = newCachedThreadPool(threadsNamed("task-processor-%s"));
  this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor);
  this.runnerThreads = runnerThreads;
  this.embedVersion = requireNonNull(embedVersion, "embedVersion is null");
  this.ticker = requireNonNull(ticker, "ticker is null");
  this.minimumNumberOfDrivers = minDrivers;
  this.guaranteedNumberOfDriversPerTask = guaranteedNumberOfDriversPerTask;
  this.maximumNumberOfDriversPerTask = maximumNumberOfDriversPerTask;
  this.waitingSplits = requireNonNull(splitQueue, "splitQueue is null");
  this.tasks = new LinkedList<>();
}
origin: prestodb/presto

@Override
public void train(Dataset dataset)
{
  params.svm_type = getLibsvmType();
  svm_problem problem = toSvmProblem(dataset);
  ExecutorService service = newCachedThreadPool(threadsNamed("libsvm-trainer-" + System.identityHashCode(this) + "-%s"));
  try {
    TimeLimiter limiter = SimpleTimeLimiter.create(service);
    //TODO: this time limit should be configurable
    model = limiter.callWithTimeout(getTrainingFunction(problem, params), 1, TimeUnit.HOURS);
  }
  catch (InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new RuntimeException(e);
  }
  catch (ExecutionException e) {
    Throwable cause = e.getCause();
    if (cause != null) {
      throwIfUnchecked(cause);
      throw new RuntimeException(cause);
    }
  }
  catch (Exception e) {
    throwIfUnchecked(e);
    throw new RuntimeException(e);
  }
  finally {
    service.shutdownNow();
  }
}
origin: prestodb/presto

@Inject
public DiscoveryNodeManager(
    @ServiceType("presto") ServiceSelector serviceSelector,
    NodeInfo nodeInfo,
    FailureDetector failureDetector,
    NodeVersion expectedNodeVersion,
    @ForNodeManager HttpClient httpClient,
    InternalCommunicationConfig internalCommunicationConfig)
{
  this.serviceSelector = requireNonNull(serviceSelector, "serviceSelector is null");
  this.failureDetector = requireNonNull(failureDetector, "failureDetector is null");
  this.expectedNodeVersion = requireNonNull(expectedNodeVersion, "expectedNodeVersion is null");
  this.httpClient = requireNonNull(httpClient, "httpClient is null");
  this.nodeStateUpdateExecutor = newSingleThreadScheduledExecutor(threadsNamed("node-state-poller-%s"));
  this.nodeStateEventExecutor = newCachedThreadPool(threadsNamed("node-state-events-%s"));
  this.httpsRequired = internalCommunicationConfig.isHttpsRequired();
  this.currentNode = findCurrentNode(
      serviceSelector.selectAllServices(),
      requireNonNull(nodeInfo, "nodeInfo is null").getNodeId(),
      expectedNodeVersion,
      httpsRequired);
  refreshNodesInternal();
}
origin: prestodb/presto

this.executionFactories = requireNonNull(executionFactories, "executionFactories is null");
this.queryExecutor = newCachedThreadPool(threadsNamed("query-scheduler-%s"));
this.queryExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) queryExecutor);
queryManagementExecutor = Executors.newScheduledThreadPool(queryManagerConfig.getQueryManagerExecutorPoolSize(), threadsNamed("query-management-%s"));
queryManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) queryManagementExecutor);
origin: prestodb/presto

taskNotificationExecutor = newFixedThreadPool(config.getTaskNotificationThreads(), threadsNamed("task-notification-%s"));
taskNotificationExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskNotificationExecutor);
this.driverYieldExecutor = newScheduledThreadPool(config.getTaskYieldThreads(), threadsNamed("task-yield-%s"));
origin: prestodb/presto

public TestSqlTask()
{
  taskExecutor = new TaskExecutor(8, 16, 3, 4, Ticker.systemTicker());
  taskExecutor.start();
  taskNotificationExecutor = newScheduledThreadPool(10, threadsNamed("task-notification-%s"));
  driverYieldExecutor = newScheduledThreadPool(2, threadsNamed("driver-yield-%s"));
  LocalExecutionPlanner planner = createTestingPlanner();
  sqlTaskExecutionFactory = new SqlTaskExecutionFactory(
      taskNotificationExecutor,
      taskExecutor,
      planner,
      createTestSplitMonitor(),
      new TaskManagerConfig());
}
origin: prestodb/presto

    .toInstance(newSingleThreadScheduledExecutor(threadsNamed("stage-scheduler")));
    .toInstance(newCachedThreadPool(threadsNamed("query-execution-%s")));
binder.bind(QueryExecutionMBean.class).in(Scopes.SINGLETON);
newExporter(binder).export(QueryExecutionMBean.class).as(generatedNameOf(QueryExecution.class));
origin: prestodb/presto

@BeforeMethod
public void setUp()
{
  memoryPool = new MemoryPool(GENERAL_POOL, new DataSize(10, BYTE));
  TaskExecutor taskExecutor = new TaskExecutor(8, 16, 3, 4, Ticker.systemTicker());
  taskExecutor.start();
  // Must be single threaded
  executor = newScheduledThreadPool(1, threadsNamed("task-notification-%s"));
  scheduledExecutor = newScheduledThreadPool(2, threadsNamed("task-notification-%s"));
  LocalExecutionPlanner planner = createTestingPlanner();
  sqlTaskExecutionFactory = new SqlTaskExecutionFactory(
      executor,
      taskExecutor,
      planner,
      createTestSplitMonitor(),
      new TaskManagerConfig());
  allOperatorContexts = null;
}
origin: prestodb/presto

  throws Exception
ScheduledExecutorService taskNotificationExecutor = newScheduledThreadPool(10, threadsNamed("task-notification-%s"));
ScheduledExecutorService driverYieldExecutor = newScheduledThreadPool(2, threadsNamed("driver-yield-%s"));
TaskExecutor taskExecutor = new TaskExecutor(5, 10, 3, 4, Ticker.systemTicker());
taskExecutor.start();
origin: prestodb/presto

  throws Exception
ScheduledExecutorService taskNotificationExecutor = newScheduledThreadPool(10, threadsNamed("task-notification-%s"));
ScheduledExecutorService driverYieldExecutor = newScheduledThreadPool(2, threadsNamed("driver-yield-%s"));
TaskExecutor taskExecutor = new TaskExecutor(5, 10, 3, 4, Ticker.systemTicker());
taskExecutor.start();
origin: io.prestosql/presto-main

public TaskManagementExecutor()
{
  taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s"));
  taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor);
}
origin: prestosql/presto

public TaskManagementExecutor()
{
  taskManagementExecutor = newScheduledThreadPool(5, threadsNamed("task-management-%s"));
  taskManagementExecutorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) taskManagementExecutor);
}
origin: uk.co.nichesolutions.presto/presto-main

@VisibleForTesting
public TaskExecutor(int runnerThreads, int minDrivers, Ticker ticker)
{
  checkArgument(runnerThreads > 0, "runnerThreads must be at least 1");
  // we manages thread pool size directly, so create an unlimited pool
  this.executor = newCachedThreadPool(threadsNamed("task-processor-%s"));
  this.executorMBean = new ThreadPoolExecutorMBean((ThreadPoolExecutor) executor);
  this.runnerThreads = runnerThreads;
  this.ticker = requireNonNull(ticker, "ticker is null");
  this.minimumNumberOfDrivers = minDrivers;
  this.pendingSplits = new PriorityBlockingQueue<>(Runtime.getRuntime().availableProcessors() * 10);
  this.tasks = new LinkedList<>();
}
origin: airlift/airlift

@BeforeClass
public final void setUp()
    throws Exception
{
  executor = Executors.newCachedThreadPool(threadsNamed("test-%s"));
}
origin: io.airlift/http-client

@BeforeClass
public final void setUp()
    throws Exception
{
  executor = Executors.newCachedThreadPool(threadsNamed("test-%s"));
}
origin: com.teradata.airlift/http-client

@BeforeClass
public final void setUp()
    throws Exception
{
  executor = Executors.newCachedThreadPool(threadsNamed("test-%s"));
}
origin: airlift/airlift

public synchronized TestingSocksProxy start()
    throws IOException
{
  checkState(serverSocket == null, "%s already started", getClass().getName());
  try {
    serverSocket = new ServerSocket(bindPort, 50, InetAddress.getByName("127.0.0.1"));
    hostAndPort = HostAndPort.fromParts(serverSocket.getInetAddress().getHostAddress(), serverSocket.getLocalPort());
    executorService = listeningDecorator(newCachedThreadPool(threadsNamed("socks-proxy-" + serverSocket.getLocalPort() + "-%s")));
    executorService.execute(new SocksProxyAcceptor(serverSocket, executorService));
    return this;
  }
  catch (Throwable e) {
    close();
    throw e;
  }
}
origin: uk.co.nichesolutions.presto/presto-main

public TestSqlTask()
{
  taskExecutor = new TaskExecutor(8, 16);
  taskExecutor.start();
  taskNotificationExecutor = newScheduledThreadPool(10, threadsNamed("task-notification-%s"));
  LocalExecutionPlanner planner = createTestingPlanner();
  sqlTaskExecutionFactory = new SqlTaskExecutionFactory(
      taskNotificationExecutor,
      taskExecutor,
      planner,
      new QueryMonitor(new ObjectMapperProvider().get(), new NullEventClient(), new NodeInfo("test"), new NodeVersion("testVersion")),
      new TaskManagerConfig());
}
io.airlift.concurrentThreadsthreadsNamed

Javadoc

Creates a ThreadFactory that creates named threads using the specified naming format.

Popular methods of Threads

  • daemonThreadsNamed
    Creates a ThreadFactory that creates named daemon threads. using the specified naming format.

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • onCreateOptionsMenu (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now