伏地魔 setMaxThreads 用法
Voldemort setMaxThreads usage
我正在学习如何使用 Voldemort。我无法理解 class ClientConfig
的以下方法
ClientConfig conf = new ClientConfig();
StoreClientFactory factory;
StoreClient<String, String> client;
conf.setBootstrapUrls(""tcp://localhost:6666");
conf.setMaxThreads(10);
factory = new SocketStoreClientFactory(conf);
client = factory.getStoreClient("storeName");
Versioned<String> value = client.get("key")
我的问题是,.setMaxThreads()
到底做了什么?它是否产生 10 个不同的线程,所有线程都执行 .get()
方法?
Voldemort 的 javadoc 只是说:"Set the maximum number of client threads"
谢谢。
StoreClient 将使用单独的线程处理单独的请求,然后当达到线程总数时,它会阻塞。
例如,如果您进行了 5 次 client.get("key")
调用,将使用 5 个线程。
我正在学习如何使用 Voldemort。我无法理解 class ClientConfig
的以下方法ClientConfig conf = new ClientConfig();
StoreClientFactory factory;
StoreClient<String, String> client;
conf.setBootstrapUrls(""tcp://localhost:6666");
conf.setMaxThreads(10);
factory = new SocketStoreClientFactory(conf);
client = factory.getStoreClient("storeName");
Versioned<String> value = client.get("key")
我的问题是,.setMaxThreads()
到底做了什么?它是否产生 10 个不同的线程,所有线程都执行 .get()
方法?
Voldemort 的 javadoc 只是说:"Set the maximum number of client threads"
谢谢。
StoreClient 将使用单独的线程处理单独的请求,然后当达到线程总数时,它会阻塞。
例如,如果您进行了 5 次 client.get("key")
调用,将使用 5 个线程。