本文整理了Java中org.apache.drill.yarn.zk.ZKClusterCoordinatorDriver.toKey()
方法的一些代码示例,展示了ZKClusterCoordinatorDriver.toKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKClusterCoordinatorDriver.toKey()
方法的具体详情如下:
包路径:org.apache.drill.yarn.zk.ZKClusterCoordinatorDriver
类名称:ZKClusterCoordinatorDriver
方法名:toKey
暂无
代码示例来源:origin: apache/drill
/**
* Convert a task to a string key used in the (zk-->task) map. Note that the
* string format here must match the one used in
* {@link #toKey(DrillbitEndpoint)} to map a drillbit endpoint to string key.
*
* @param task
* the task tracked by the cluster controller
* @return a string key for this object
*/
private String toKey(Task task) {
return zkDriver.toKey(task.getHostName());
}
代码示例来源:origin: apache/drill
/**
* Validate that the key format used for endpoint is the same as that
* generated for hosts coming from YARN.
*/
@Test
public void testFormat() {
DrillbitEndpoint dbe = makeEndpoint(TEST_HOST);
assertEquals(makeKey(TEST_HOST), ZKClusterCoordinatorDriver.asString(dbe));
ZKClusterCoordinatorDriver driver = new ZKClusterCoordinatorDriver()
.setPorts(123, 456, 789);
assertEquals(makeKey(TEST_HOST), driver.toKey(TEST_HOST));
// Internal default ports (used mostly for testing.)
driver = new ZKClusterCoordinatorDriver();
assertEquals("fred:31010:31011:31012", driver.toKey(FRED_HOST));
}
内容来源于网络,如有侵权,请联系作者删除!