我想运行一些点火服务器节点并从中创建一个单独的群集组(称之为"WORKER"
)。来自此群集组的节点应该来自点燃队列的take()
个元素,以某种方式处理它并将某些内容放入具有群集组"CACHE"
的节点上的缓存中。这是它的样子:
public interface Batch{ }
public class Runner{
//initialize batchesToProcess as ignite distrubted queue
Queue<Batch> batchesToProcess;
//I need Ignite here.
//@IgniteInstanceResource does not work this way
//Because this is just a bean declared in ingite spring configuration
private Ignite ignite;
public void executeLogic(){
Batch b = batchesToProcess.take();
String cacheName;
String key;
String value;
//process Batch b, get 3 strings
//1. cache name
//2. key
//3. value
IgniteCache<String, String> cache = ignite.getOrCreateCache(cacheName);
cache.put(key, value);
}
}
我想通过使用指定的配置运行./ignite.sh _configuration_
来启动此节点。
问题是我不知道如何编写此_configuration_
,因此只需将此配置文件提供给./ignite.sh
即可运行。也许我应该抓住ContextRefreshedEvent
然后把它