当前位置: 首页>>代码示例>>Java>>正文


Java Server类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.Server的典型用法代码示例。如果您正苦于以下问题:Java Server类的具体用法?Java Server怎么用?Java Server使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Server类属于org.apache.hadoop.hbase包,在下文中一共展示了Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MasterFileSystem

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public MasterFileSystem(Server master, MasterServices services)
throws IOException {
  this.conf = master.getConfiguration();
  this.master = master;
  this.services = services;
  // Set filesystem to be that of this.rootdir else we get complaints about
  // mismatched filesystems if hbase.rootdir is hdfs and fs.defaultFS is
  // default localfs.  Presumption is that rootdir is fully-qualified before
  // we get to here with appropriate fs scheme.
  this.rootdir = FSUtils.getRootDir(conf);
  this.tempdir = new Path(this.rootdir, HConstants.HBASE_TEMP_DIRECTORY);
  // Cover both bases, the old way of setting default fs and the new.
  // We're supposed to run on 0.20 and 0.21 anyways.
  this.fs = this.rootdir.getFileSystem(conf);
  FSUtils.setFsDefault(conf, new Path(this.fs.getUri()));
  // make sure the fs has the same conf
  fs.setConf(conf);
  // setup the filesystem variable
  // set up the archived logs path
  this.oldLogDir = createInitialFileSystemLayout();
  HFileSystem.addLocationsOrderInterceptor(conf);
  this.splitLogManager =
      new SplitLogManager(master, master.getConfiguration(), master, services,
          master.getServerName());
  this.distributedLogReplay = this.splitLogManager.isLogReplaying();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:MasterFileSystem.java

示例2: ServerManager

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
ServerManager(final Server master, final MasterServices services,
    final boolean connect) throws IOException {
  this.master = master;
  this.services = services;
  Configuration c = master.getConfiguration();
  maxSkew = c.getLong("hbase.master.maxclockskew", 30000);
  warningSkew = c.getLong("hbase.master.warningclockskew", 10000);
  this.connection = connect ? (ClusterConnection)ConnectionFactory.createConnection(c) : null;
  int pingMaxAttempts = Math.max(1, master.getConfiguration().getInt(
    "hbase.master.maximum.ping.server.attempts", 10));
  int pingSleepInterval = Math.max(1, master.getConfiguration().getInt(
    "hbase.master.ping.server.retry.sleep.interval", 100));
  this.pingRetryCounterFactory = new RetryCounterFactory(pingMaxAttempts, pingSleepInterval);
  this.rpcControllerFactory = this.connection == null
      ? null
      : connection.getRpcControllerFactory();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:ServerManager.java

示例3: OpenedRegionHandler

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public OpenedRegionHandler(Server server,
    AssignmentManager assignmentManager, HRegionInfo regionInfo,
    OpenRegionCoordination coordination,
    OpenRegionCoordination.OpenRegionDetails ord) {
  super(server, EventType.RS_ZK_REGION_OPENED);
  this.assignmentManager = assignmentManager;
  this.regionInfo = regionInfo;
  this.coordination = coordination;
  this.ord = ord;
  if(regionInfo.isMetaRegion()) {
    priority = OpenedPriority.META;
  } else if(regionInfo.getTable()
      .getNamespaceAsString().equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {
    priority = OpenedPriority.SYSTEM;
  } else {
    priority = OpenedPriority.USER;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:OpenedRegionHandler.java

示例4: 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);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:SplitLogManager.java

示例5: OpenRegion

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
private void OpenRegion(Server server, RegionServerServices rss,
    HTableDescriptor htd, HRegionInfo hri, OpenRegionCoordination coordination)
throws IOException, NodeExistsException, KeeperException, DeserializationException {
  // Create it OFFLINE node, which is what Master set before sending OPEN RPC
  ZKAssign.createNodeOffline(server.getZooKeeper(), hri, server.getServerName());

  OpenRegionCoordination.OpenRegionDetails ord =
    coordination.getDetailsForNonCoordinatedOpening();
  OpenRegionHandler openHandler =
    new OpenRegionHandler(server, rss, hri, htd, -1, coordination, ord);
  rss.getRegionsInTransitionInRS().put(hri.getEncodedNameAsBytes(), Boolean.TRUE);
  openHandler.process();
  // This parse is not used?
  RegionTransition.parseFrom(ZKAssign.getData(server.getZooKeeper(), hri.getEncodedName()));
  // delete the node, which is what Master do after the region is opened
  ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
    EventType.RS_ZK_REGION_OPENED, server.getServerName());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TestCloseRegionHandler.java

示例6: rollback

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
@Override
public boolean rollback(Server server, RegionServerServices services) throws IOException {
  if (this.currentRegion.getRegionInfo().getTable().getNameAsString()
      .equals("testShouldFailSplitIfZNodeDoesNotExistDueToPrevRollBack")) {
    if(secondSplit){
      super.rollback(server, services);
      latch.countDown();
      return true;
    }
  }
  return super.rollback(server, services);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:TestSplitTransactionOnCluster.java

示例7: initialize

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
@Override
public void initialize(Server server) {
  this.server = server;
  this.watcher = server.getZooKeeper();
  splitLogWorkerCoordination = new ZkSplitLogWorkerCoordination(this, watcher);
  splitLogManagerCoordination = new ZKSplitLogManagerCoordination(this, watcher);
  splitTransactionCoordination = new ZKSplitTransactionCoordination(this, watcher);
  closeRegionCoordination = new ZkCloseRegionCoordination(this, watcher);
  openRegionCoordination = new ZkOpenRegionCoordination(this, watcher);
  regionMergeCoordination = new ZkRegionMergeCoordination(this, watcher);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:ZkCoordinatedStateManager.java

示例8: RegionStates

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
RegionStates(final Server master, final TableStateManager tableStateManager,
    final ServerManager serverManager, final RegionStateStore regionStateStore) {
  this.tableStateManager = tableStateManager;
  this.regionStateStore = regionStateStore;
  this.serverManager = serverManager;
  this.server = master;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:RegionStates.java

示例9: CatalogJanitor

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
CatalogJanitor(final Server server, final MasterServices services) {
  super("CatalogJanitor-" + server.getServerName().toShortString(), server, server
      .getConfiguration().getInt("hbase.catalogjanitor.interval", 300000));
  this.server = server;
  this.services = services;
  this.connection = server.getConnection();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:CatalogJanitor.java

示例10: RegionStateStore

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
RegionStateStore(final Server server) {
  Configuration conf = server.getConfiguration();
  // No need to persist if using ZK but not migrating
  noPersistence = ConfigUtil.useZKForAssignment(conf)
    && !conf.getBoolean("hbase.assignment.usezk.migrating", false);
  this.server = server;
  initialized = false;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:RegionStateStore.java

示例11: CreateTableHandler

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public CreateTableHandler(Server server, MasterFileSystem fileSystemManager,
    HTableDescriptor hTableDescriptor, Configuration conf, HRegionInfo [] newRegions,
    MasterServices masterServices) {
  super(server, EventType.C_M_CREATE_TABLE);

  this.fileSystemManager = fileSystemManager;
  this.hTableDescriptor = hTableDescriptor;
  this.conf = conf;
  this.newRegions = newRegions;
  this.assignmentManager = masterServices.getAssignmentManager();
  this.tableLockManager = masterServices.getTableLockManager();

  this.tableLock = this.tableLockManager.writeLock(this.hTableDescriptor.getTableName()
      , EventType.C_M_CREATE_TABLE.toString());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:CreateTableHandler.java

示例12: DisableTableHandler

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public DisableTableHandler(Server server, TableName tableName,
    AssignmentManager assignmentManager, TableLockManager tableLockManager,
    boolean skipTableStateCheck) {
  super(server, EventType.C_M_DISABLE_TABLE);
  this.tableName = tableName;
  this.assignmentManager = assignmentManager;
  this.tableLockManager = tableLockManager;
  this.skipTableStateCheck = skipTableStateCheck;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:DisableTableHandler.java

示例13: EnableTableHandler

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public EnableTableHandler(Server server, TableName tableName,
    AssignmentManager assignmentManager, TableLockManager tableLockManager,
    boolean skipTableStateCheck) {
  super(server, EventType.C_M_ENABLE_TABLE);
  this.tableName = tableName;
  this.assignmentManager = assignmentManager;
  this.tableLockManager = tableLockManager;
  this.skipTableStateCheck = skipTableStateCheck;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:EnableTableHandler.java

示例14: ClosedRegionHandler

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public ClosedRegionHandler(Server server, AssignmentManager assignmentManager,
    HRegionInfo regionInfo) {
  super(server, EventType.RS_ZK_REGION_CLOSED);
  this.assignmentManager = assignmentManager;
  this.regionInfo = regionInfo;
  if(regionInfo.isMetaRegion()) {
    priority = ClosedPriority.META;
  } else {
    priority = ClosedPriority.USER;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:ClosedRegionHandler.java

示例15: GeneralBulkAssigner

import org.apache.hadoop.hbase.Server; //导入依赖的package包/类
public GeneralBulkAssigner(final Server server,
    final Map<ServerName, List<HRegionInfo>> bulkPlan,
    final AssignmentManager am, final boolean waitTillAllAssigned) {
  super(server);
  this.bulkPlan = bulkPlan;
  this.assignmentManager = am;
  this.waitTillAllAssigned = waitTillAllAssigned;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:GeneralBulkAssigner.java


注:本文中的org.apache.hadoop.hbase.Server类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。