本文整理汇总了Java中org.apache.hadoop.lib.service.Scheduler类的典型用法代码示例。如果您正苦于以下问题:Java Scheduler类的具体用法?Java Scheduler怎么用?Java Scheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Scheduler类属于org.apache.hadoop.lib.service包,在下文中一共展示了Scheduler类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: postInit
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Override
public void postInit() throws ServiceException {
super.postInit();
Instrumentation instrumentation = getServer().get(Instrumentation.class);
instrumentation.addVariable(INSTRUMENTATION_GROUP, "unmanaged.fs", new Instrumentation.Variable<Integer>() {
@Override
public Integer getValue() {
return unmanagedFileSystems.get();
}
});
instrumentation.addSampler(INSTRUMENTATION_GROUP, "unmanaged.fs", 60, new Instrumentation.Variable<Long>() {
@Override
public Long getValue() {
return (long) unmanagedFileSystems.get();
}
});
Scheduler scheduler = getServer().get(Scheduler.class);
int purgeInterval = getServiceConfig().getInt(FS_CACHE_PURGE_FREQUENCY, 60);
purgeTimeout = getServiceConfig().getLong(FS_CACHE_PURGE_TIMEOUT, 60);
purgeTimeout = (purgeTimeout > 0) ? purgeTimeout : 0;
if (purgeTimeout > 0) {
scheduler.schedule(new FileSystemCachePurger(),
purgeInterval, purgeInterval, TimeUnit.SECONDS);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:FileSystemAccessService.java
示例2: postInit
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Override
public void postInit() throws ServiceException {
Scheduler scheduler = getServer().get(Scheduler.class);
if (scheduler != null) {
scheduler.schedule(new SamplersRunnable(), 0, 1, TimeUnit.SECONDS);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:InstrumentationService.java
示例3: service
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Test
@TestDir
public void service() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
conf.set("server.services", StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(),
SchedulerService.class.getName())));
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
assertNotNull(server.get(Scheduler.class));
server.destroy();
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestSchedulerService.java
示例4: postInit
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Override
public void postInit() throws ServiceException {
super.postInit();
Instrumentation instrumentation = getServer().get(Instrumentation.class);
instrumentation.addVariable(INSTRUMENTATION_GROUP, "unmanaged.fs",
new Instrumentation.Variable<Integer>() {
@Override
public Integer getValue() {
return unmanagedFileSystems.get();
}
});
instrumentation.addSampler(INSTRUMENTATION_GROUP, "unmanaged.fs", 60,
new Instrumentation.Variable<Long>() {
@Override
public Long getValue() {
return (long) unmanagedFileSystems.get();
}
});
Scheduler scheduler = getServer().get(Scheduler.class);
int purgeInterval = getServiceConfig().getInt(FS_CACHE_PURGE_FREQUENCY, 60);
purgeTimeout = getServiceConfig().getLong(FS_CACHE_PURGE_TIMEOUT, 60);
purgeTimeout = (purgeTimeout > 0) ? purgeTimeout : 0;
if (purgeTimeout > 0) {
scheduler
.schedule(new FileSystemCachePurger(), purgeInterval, purgeInterval,
TimeUnit.SECONDS);
}
}
开发者ID:hopshadoop,项目名称:hops,代码行数:29,代码来源:FileSystemAccessService.java
示例5: service
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Test
@TestDir
public void service() throws Exception {
String dir = TestDirHelper.getTestDir().getAbsolutePath();
Configuration conf = new Configuration(false);
conf.set("server.services", StringUtils.join(",", Arrays
.asList(InstrumentationService.class.getName(),
SchedulerService.class.getName())));
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
assertNotNull(server.get(Scheduler.class));
server.destroy();
}
开发者ID:hopshadoop,项目名称:hops,代码行数:14,代码来源:TestSchedulerService.java
示例6: getServiceDependencies
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Override
public Class[] getServiceDependencies() {
return new Class[]{Instrumentation.class, Scheduler.class};
}
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:FileSystemAccessService.java
示例7: getInterface
import org.apache.hadoop.lib.service.Scheduler; //导入依赖的package包/类
@Override
public Class getInterface() {
return Scheduler.class;
}
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:SchedulerService.java
注:本文中的org.apache.hadoop.lib.service.Scheduler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论