本文整理汇总了Java中org.apache.hadoop.hbase.Server.getCoordinatedStateManager方法的典型用法代码示例。如果您正苦于以下问题:Java Server.getCoordinatedStateManager方法的具体用法?Java Server.getCoordinatedStateManager怎么用?Java Server.getCoordinatedStateManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.Server
的用法示例。
在下文中一共展示了Server.getCoordinatedStateManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SplitLogManager
import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
/**
* Its OK to construct this object even when region-servers are not online. It does lookup the
* orphan tasks in coordination engine but it doesn't block waiting for them to be done.
* @param server the server instance
* @param conf the HBase configuration
* @param stopper the stoppable in case anything is wrong
* @param master the master services
* @param serverName the master server name
* @throws IOException
*/
public SplitLogManager(Server server, Configuration conf, Stoppable stopper,
MasterServices master, ServerName serverName) throws IOException {
this.server = server;
this.conf = conf;
this.stopper = stopper;
this.choreService = new ChoreService(serverName.toString() + "_splitLogManager_");
if (server.getCoordinatedStateManager() != null) {
SplitLogManagerCoordination coordination =
((BaseCoordinatedStateManager) server.getCoordinatedStateManager())
.getSplitLogManagerCoordination();
Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
SplitLogManagerDetails details =
new SplitLogManagerDetails(tasks, master, failedDeletions, serverName);
coordination.setDetails(details);
coordination.init();
// Determine recovery mode
}
this.unassignedTimeout =
conf.getInt("hbase.splitlog.manager.unassigned.timeout", DEFAULT_UNASSIGNED_TIMEOUT);
this.timeoutMonitor =
new TimeoutMonitor(conf.getInt("hbase.splitlog.manager.timeoutmonitor.period", 1000),
stopper);
choreService.scheduleChore(timeoutMonitor);
}
示例2: useCoordinatedStateManager
import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
private boolean useCoordinatedStateManager(final Server server) {
return server != null && useZKForAssignment && server.getCoordinatedStateManager() != null;
}
示例3: execute
import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
@Override
public HRegion execute(final Server server, final RegionServerServices services, User user)
throws IOException {
this.server = server;
this.rsServices = services;
useCoordinationForAssignment =
server == null ? true : ConfigUtil.useZKForAssignment(server.getConfiguration());
if (rmd == null) {
rmd = server != null && server.getCoordinatedStateManager() != null ?
((BaseCoordinatedStateManager) server.getCoordinatedStateManager())
.getRegionMergeCoordination().getDefaultDetails()
: null;
}
if (rsCoprocessorHost == null) {
rsCoprocessorHost = server != null ?
((HRegionServer) server).getRegionServerCoprocessorHost() : null;
}
final HRegion mergedRegion = createMergedRegion(server, services, user);
if (rsCoprocessorHost != null) {
if (user == null) {
rsCoprocessorHost.postMergeCommit(this.region_a, this.region_b, mergedRegion);
} else {
try {
user.getUGI().doAs(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws Exception {
rsCoprocessorHost.postMergeCommit(region_a, region_b, mergedRegion);
return null;
}
});
} catch (InterruptedException ie) {
InterruptedIOException iioe = new InterruptedIOException();
iioe.initCause(ie);
throw iioe;
}
}
}
stepsAfterPONR(server, services, mergedRegion, user);
transition(RegionMergeTransactionPhase.COMPLETED);
return mergedRegion;
}
示例4: useCoordination
import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
private boolean useCoordination(final Server server) {
return server != null && useCoordinationForAssignment
&& server.getCoordinatedStateManager() != null;
}