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


Java ZKClusterId.getUUIDForCluster方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.zookeeper.ZKClusterId.getUUIDForCluster方法的典型用法代码示例。如果您正苦于以下问题:Java ZKClusterId.getUUIDForCluster方法的具体用法?Java ZKClusterId.getUUIDForCluster怎么用?Java ZKClusterId.getUUIDForCluster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.zookeeper.ZKClusterId的用法示例。


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

示例1: getPeerUUID

import org.apache.hadoop.hbase.zookeeper.ZKClusterId; //导入方法依赖的package包/类
@Override
// Synchronize peer cluster connection attempts to avoid races and rate
// limit connections when multiple replication sources try to connect to
// the peer cluster. If the peer cluster is down we can get out of control
// over time.
public synchronized UUID getPeerUUID() {
  UUID peerUUID = null;
  try {
    peerUUID = ZKClusterId.getUUIDForCluster(zkw);
  } catch (KeeperException ke) {
    reconnect(ke);
  }
  return peerUUID;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:HBaseReplicationEndpoint.java

示例2: getPeerUUID

import org.apache.hadoop.hbase.zookeeper.ZKClusterId; //导入方法依赖的package包/类
@Override
public UUID getPeerUUID(String peerId) {
  ReplicationPeer peer = this.peerClusters.get(peerId);
  if (peer == null) {
    return null;
  }
  UUID peerUUID = null;
  try {
    peerUUID = ZKClusterId.getUUIDForCluster(peer.getZkw());
  } catch (KeeperException ke) {
    reconnectPeer(ke, peer);
  }
  return peerUUID;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:15,代码来源:ReplicationPeersZKImpl.java

示例3: initialize

import org.apache.hadoop.hbase.zookeeper.ZKClusterId; //导入方法依赖的package包/类
public void initialize(final Server server, final FileSystem fs,
    final Path logDir, final Path oldLogDir) throws IOException {
  this.server = server;
  this.conf = this.server.getConfiguration();
  this.replication = isReplication(this.conf);
  this.scheduleThreadPool = Executors.newScheduledThreadPool(1,
    new ThreadFactoryBuilder()
      .setNameFormat(server.getServerName().toShortString() + "Replication Statistics #%d")
      .setDaemon(true)
      .build());
  if (replication) {
    try {
      this.replicationQueues =
          ReplicationFactory.getReplicationQueues(server.getZooKeeper(), this.conf, this.server);
      this.replicationQueues.init(this.server.getServerName().toString());
      this.replicationPeers =
          ReplicationFactory.getReplicationPeers(server.getZooKeeper(), this.conf, this.server);
      this.replicationPeers.init();
      this.replicationTracker =
          ReplicationFactory.getReplicationTracker(server.getZooKeeper(), this.replicationPeers,
            this.conf, this.server, this.server);
    } catch (ReplicationException e) {
      throw new IOException("Failed replication handler create", e);
    }
    UUID clusterId = null;
    try {
      clusterId = ZKClusterId.getUUIDForCluster(this.server.getZooKeeper());
    } catch (KeeperException ke) {
      throw new IOException("Could not read cluster id", ke);
    }
    this.replicationManager =
        new ReplicationSourceManager(replicationQueues, replicationPeers, replicationTracker,
            conf, this.server, fs, logDir, oldLogDir, clusterId);
    this.statsThreadPeriod =
        this.conf.getInt("replication.stats.thread.period.seconds", 5 * 60);
    LOG.debug("ReplicationStatisticsThread " + this.statsThreadPeriod);
    this.replicationLoad = new ReplicationLoad();
  } else {
    this.replicationManager = null;
    this.replicationQueues = null;
    this.replicationPeers = null;
    this.replicationTracker = null;
    this.replicationLoad = null;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:46,代码来源:Replication.java

示例4: initialize

import org.apache.hadoop.hbase.zookeeper.ZKClusterId; //导入方法依赖的package包/类
public void initialize(final Server server, final FileSystem fs,
    final Path logDir, final Path oldLogDir) throws IOException {
  this.server = server;
  this.conf = this.server.getConfiguration();
  this.replication = isReplication(this.conf);
  this.scheduleThreadPool = Executors.newScheduledThreadPool(1,
    new ThreadFactoryBuilder()
      .setNameFormat(server.getServerName().toShortString() + "Replication Statistics #%d")
      .setDaemon(true)
      .build());
  if (replication) {
    try {
      this.replicationQueues =
          ReplicationFactory.getReplicationQueues(server.getZooKeeper(), this.conf, this.server);
      this.replicationQueues.init(this.server.getServerName().toString());
      this.replicationPeers =
          ReplicationFactory.getReplicationPeers(server.getZooKeeper(), this.conf, this.server);
      this.replicationPeers.init();
      this.replicationTracker =
          ReplicationFactory.getReplicationTracker(server.getZooKeeper(), this.replicationPeers,
            this.conf, this.server, this.server);
    } catch (ReplicationException e) {
      throw new IOException("Failed replication handler create", e);
    }
    UUID clusterId = null;
    try {
      clusterId = ZKClusterId.getUUIDForCluster(this.server.getZooKeeper());
    } catch (KeeperException ke) {
      throw new IOException("Could not read cluster id", ke);
    }
    this.replicationManager =
        new ReplicationSourceManager(replicationQueues, replicationPeers, replicationTracker,
            conf, this.server, fs, logDir, oldLogDir, clusterId);
    this.statsThreadPeriod =
        this.conf.getInt("replication.stats.thread.period.seconds", 5 * 60);
    LOG.debug("ReplicationStatisticsThread " + this.statsThreadPeriod);
  } else {
    this.replicationManager = null;
    this.replicationQueues = null;
    this.replicationPeers = null;
    this.replicationTracker = null;
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:44,代码来源:Replication.java

示例5: initialize

import org.apache.hadoop.hbase.zookeeper.ZKClusterId; //导入方法依赖的package包/类
@Override
public void initialize(Server server, FileSystem fs, Path logDir, Path oldLogDir,
    WALProvider walProvider) throws IOException {
  this.server = server;
  this.conf = this.server.getConfiguration();
  this.isReplicationForBulkLoadDataEnabled =
    ReplicationUtils.isReplicationForBulkLoadDataEnabled(this.conf);
  this.scheduleThreadPool = Executors.newScheduledThreadPool(1,
    new ThreadFactoryBuilder()
      .setNameFormat(server.getServerName().toShortString() + "Replication Statistics #%d")
      .setDaemon(true)
      .build());
  if (this.isReplicationForBulkLoadDataEnabled) {
    if (conf.get(HConstants.REPLICATION_CLUSTER_ID) == null
        || conf.get(HConstants.REPLICATION_CLUSTER_ID).isEmpty()) {
      throw new IllegalArgumentException(HConstants.REPLICATION_CLUSTER_ID
          + " cannot be null/empty when " + HConstants.REPLICATION_BULKLOAD_ENABLE_KEY
          + " is set to true.");
    }
  }

  try {
    this.queueStorage =
        ReplicationStorageFactory.getReplicationQueueStorage(server.getZooKeeper(), conf);
    this.replicationPeers =
        ReplicationFactory.getReplicationPeers(server.getZooKeeper(), this.conf);
    this.replicationPeers.init();
    this.replicationTracker =
        ReplicationFactory.getReplicationTracker(server.getZooKeeper(), this.server, this.server);
  } catch (Exception e) {
    throw new IOException("Failed replication handler create", e);
  }
  UUID clusterId = null;
  try {
    clusterId = ZKClusterId.getUUIDForCluster(this.server.getZooKeeper());
  } catch (KeeperException ke) {
    throw new IOException("Could not read cluster id", ke);
  }
  this.replicationManager = new ReplicationSourceManager(queueStorage, replicationPeers,
      replicationTracker, conf, this.server, fs, logDir, oldLogDir, clusterId,
      walProvider != null ? walProvider.getWALFileLengthProvider() : p -> OptionalLong.empty());
  if (walProvider != null) {
    walProvider
      .addWALActionsListener(new ReplicationSourceWALActionListener(conf, replicationManager));
  }
  this.statsThreadPeriod =
      this.conf.getInt("replication.stats.thread.period.seconds", 5 * 60);
  LOG.debug("ReplicationStatisticsThread " + this.statsThreadPeriod);
  this.replicationLoad = new ReplicationLoad();

  this.peerProcedureHandler = new PeerProcedureHandlerImpl(replicationManager);
}
 
开发者ID:apache,项目名称:hbase,代码行数:53,代码来源:Replication.java


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