Tabnine Logo
RedissonClient.getExecutorService
Code IndexAdd Tabnine to your IDE (free)

How to use
getExecutorService
method
in
org.redisson.api.RedissonClient

Best Java code snippets using org.redisson.api.RedissonClient.getExecutorService (Showing top 20 results out of 315)

origin: redisson/redisson

public MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) {
  this.objectName = object.getName();
  this.objectCodec = object.getCodec();
  this.objectClass = object.getClass();
  this.redisson = redisson;
  UUID id = UUID.randomUUID();
  this.resultMapName = object.getName() + ":result:" + id;
  this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
  this.connectionManager = connectionManager;
}
origin: redisson/redisson

public MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) {
  this.objectName = object.getName();
  this.objectCodec = object.getCodec();
  this.objectClass = object.getClass();
  this.redisson = redisson;
  UUID id = UUID.randomUUID();
  this.resultMapName = object.getName() + ":result:" + id;
  this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
  this.connectionManager = connectionManager;
}
origin: redisson/redisson

  mapReduceWorkers = Runtime.getRuntime().availableProcessors();
redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME).registerWorkers(mapReduceWorkers);
log.info("{} map reduce worker(s) registered", mapReduceWorkers);
String name = entry.getKey();
int workers = entry.getValue();
redisson.getExecutorService(name).registerWorkers(workers);
log.info("{} worker(s) for '{}' ExecutorService registered", workers, name);
origin: redisson/redisson

  mapReduceWorkers = Runtime.getRuntime().availableProcessors();
redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME).registerWorkers(mapReduceWorkers);
log.info("{} map reduce worker(s) registered", mapReduceWorkers);
String name = entry.getKey();
int workers = entry.getValue();
redisson.getExecutorService(name).registerWorkers(workers);
log.info("{} worker(s) for '{}' ExecutorService registered", workers, name);
origin: redisson/redisson

RScheduledExecutorService executor = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
int workersAmount = executor.countActiveWorkers();
origin: redisson/redisson

RScheduledExecutorService executor = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
int workersAmount = executor.countActiveWorkers();
origin: org.redisson/redisson

public MapReduceExecutor(RObject object, RedissonClient redisson, ConnectionManager connectionManager) {
  this.objectName = object.getName();
  this.objectCodec = object.getCodec();
  this.objectClass = object.getClass();
  this.redisson = redisson;
  UUID id = UUID.randomUUID();
  this.resultMapName = object.getName() + ":result:" + id;
  this.executorService = redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME);
  this.connectionManager = connectionManager;
}
origin: justlive1/earth-frost

@Override
public void publish(Event event) {
 redissonClient.getExecutorService(JobConfig.EVENT).execute(new EventExecuteWrapper(event));
}
origin: justlive1/earth-frost

@Override
public void pauseJob(String jobId) {
 RListMultimap<String, String> listmap = getRedissonClient().getListMultimap(JobConfig.TASK_ID);
 RScheduledExecutorService service = getRedissonClient().getExecutorService(JobConfig.WORKER);
 Iterator<String> it = listmap.get(jobId).iterator();
 while (it.hasNext()) {
  String id = it.next();
  service.cancelTask(id);
  it.remove();
 }
}
origin: justlive1/earth-frost

@Override
public int count(JobExecuteParam param) {
 int workers = redissonClient.getExecutorService(param.getTopicKey()).countActiveWorkers();
 if (workers == 0) {
  throw Exceptions.fail("30000", "没有可调度的执行器");
 }
 return workers;
}
origin: justlive1/earth-frost

@Override
public void triggerJob(String jobId) {
 getRedissonClient().getExecutorService(JobConfig.WORKER).submit(new JobDispatchWrapper(jobId));
}
origin: justlive1/earth-frost

@Override
public String addSimpleJob(String jobId, long timestamp) {
 String taskId = getRedissonClient().getExecutorService(JobConfig.WORKER)
   .scheduleAsync(new JobDispatchWrapper(jobId),
     timestamp - ZonedDateTime.now().toInstant().toEpochMilli(), TimeUnit.MILLISECONDS)
   .getTaskId();
 getRedissonClient().<String, String>getListMultimap(JobConfig.TASK_ID).put(jobId, taskId);
 return taskId;
}
origin: justlive1/earth-frost

@Override
public void retryJob(String jobId, String loggerId, String parentLoggerId) {
 JobDispatchWrapper wrapper = new JobDispatchWrapper(jobId, loggerId);
 wrapper.setParentLoggerId(parentLoggerId);
 getRedissonClient().getExecutorService(JobConfig.WORKER).submit(wrapper);
}
origin: justlive1/earth-frost

@Override
public void triggerChildJob(String jobId, String loggerId) {
 JobDispatchWrapper wrapper = new JobDispatchWrapper(jobId);
 wrapper.setParentLoggerId(loggerId);
 getRedissonClient().getExecutorService(JobConfig.WORKER).submit(wrapper);
}
origin: justlive1/earth-frost

@Override
public void dispatch(JobExecuteParam param) {
 JobInfo jobInfo = jobRepository.findJobInfoById(param.getJobId());
 if (jobInfo == null) {
  throw Exceptions.fail("30005", String.format("未查询到任务 %s", param));
 }
 this.checkDispatch(param);
 if (Objects.equals(JobInfo.TYPE.SCRIPT.name(), jobInfo.getType())) {
  redissonClient.getExecutorService(param.getTopicKey())
    .execute(new JobScriptExecuteWrapper(param));
 } else {
  redissonClient.getExecutorService(param.getTopicKey())
    .execute(new JobBeanExecuteWrapper(param));
 }
}
origin: justlive1/earth-frost

 @PostConstruct
 public void initCenter() {
  Bootstrap.start();
  RedissonClient redissonClient = BeanStore.getBean(RedissonClient.class);
  JobRepository jobRepository = BeanStore.getBean(JobRepository.class);
  // schedule
  BeanStore.putBean(RedisJobScheduleImpl.class.getName(), new RedisJobScheduleImpl());
  // dispatcher
  BeanStore.putBean(RedisDispatcher.class.getName(),
    new RedisDispatcher(redissonClient, jobRepository));
  redissonClient.getExecutorService(JobConfig.EVENT)
    .registerWorkers(ConfigFactory.load(SystemProperties.class).getWorkers());
  BeanStore.putBean(EventListener.class.getName(), new EventListener(notifier));
 }
}
origin: justlive1/earth-frost

@Override
public String addDelayJob(String jobId, long initDelay, long delay) {
 String taskId = getRedissonClient().getExecutorService(JobConfig.WORKER)
   .scheduleAtFixedRateAsync(new JobDispatchWrapper(jobId), initDelay, delay, TimeUnit.SECONDS)
   .getTaskId();
 getRedissonClient().<String, String>getListMultimap(JobConfig.TASK_ID).put(jobId, taskId);
 return taskId;
}
origin: justlive1/earth-frost

@Override
public String addCronJob(String jobId, String cron) {
 String taskId = getRedissonClient().getExecutorService(JobConfig.WORKER)
   .scheduleAsync(new JobDispatchWrapper(jobId), CronSchedule.of(cron)).getTaskId();
 getRedissonClient().<String, String>getListMultimap(
   JobConfig.TASK_ID).put(jobId, taskId);
 return taskId;
}
origin: justlive1/earth-frost

public RedisJobScheduleImpl() {
 SystemProperties props = ConfigFactory.load(SystemProperties.class);
 getRedissonClient().getExecutorService(JobConfig.WORKER)
   .registerWorkers(JobConfig.getParallel(), ThreadUtils
     .newThreadPool(props.getCorePoolSize(), props.getMaximumPoolSize(),
       props.getKeepAliveTime(), props.getQueueCapacity(), "redisson-executor-pool-%d"));
}
origin: redisson/redisson-examples

public static void main(String[] args) {
  Config config = new Config();
  config.useClusterServers()
    .addNodeAddress("127.0.0.1:7001", "127.0.0.1:7002", "127.0.0.1:7003");
  
  RedissonClient redisson = Redisson.create(config);
  RedissonNodeConfig nodeConfig = new RedissonNodeConfig(config);
  nodeConfig.setExecutorServiceWorkers(Collections.singletonMap("myExecutor", 1));
  RedissonNode node = RedissonNode.create(nodeConfig);
  node.start();
  RExecutorService e = redisson.getExecutorService("myExecutor");
  e.execute(new RunnableTask());
  e.submit(new CallableTask());
  
  e.shutdown();
  node.shutdown();
}

org.redisson.apiRedissonClientgetExecutorService

Javadoc

Returns ScheduledExecutorService by name

Popular methods of RedissonClient

  • shutdown
    Shuts down Redisson instance but NOT Redis server Shutdown ensures that no tasks are submitted for '
  • getMap
    Returns map instance by name using provided codec for both map keys and values.
  • getLock
    Returns lock instance by name. Implements a non-fair locking so doesn't guarantees an acquire order
  • getTopic
    Returns topic instance by name using provided codec for messages.
  • getBucket
    Returns object holder instance by name using provided codec for object.
  • getConfig
    Allows to get configuration provided during Redisson instance creation. Further changes on this obje
  • getMapCache
    Returns map-based cache instance by name using provided codec for both cache keys and values. Suppor
  • getAtomicLong
    Returns atomicLong instance by name.
  • getKeys
    Returns interface with methods for Redis keys. Each of Redis/Redisson object associated with own key
  • getScript
    Returns script operations object using provided codec.
  • getSemaphore
    Returns semaphore instance by name
  • getSet
    Returns set instance by name using provided codec for set objects.
  • getSemaphore,
  • getSet,
  • getBlockingQueue,
  • getList,
  • getScoredSortedSet,
  • getFairLock,
  • getQueue,
  • getReadWriteLock,
  • getListMultimap

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JFileChooser (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best plugins for Eclipse
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