org.lilyproject.sep.ZooKeeperItfAdapter.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(74)

本文整理了Java中org.lilyproject.sep.ZooKeeperItfAdapter.<init>()方法的一些代码示例,展示了ZooKeeperItfAdapter.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperItfAdapter.<init>()方法的具体详情如下:
包路径:org.lilyproject.sep.ZooKeeperItfAdapter
类名称:ZooKeeperItfAdapter
方法名:<init>

ZooKeeperItfAdapter.<init>介绍

[英]Construct an adapter around a Lily ZooKeeperItf.
[中]在Lily Zookeef周围构建一个适配器。

代码示例

代码示例来源:origin: NGDATA/lilyproject

/**
 * Start a SEP event processor. Only a single SEP event processor is supported within the
 * context of this class.
 *
 * @param subscriptionId The id of the subscription for which the slave will process events
 * @param eventListener The listener to handle incoming events
 */
public void startSepEventSlave(String subscriptionId, EventListener eventListener) throws Exception {
  if (sepConsumer != null) {
    throw new IllegalStateException("There is already a SepEventSlave running, stop it first");
  }
  sepConsumer = new SepConsumer(subscriptionId, System.currentTimeMillis(), eventListener, 1, "localhost",
      new ZooKeeperItfAdapter(zk), hadoopConf, new LilyPayloadExtractor());
  sepConsumer.start();
}

代码示例来源:origin: NGDATA/lilyproject

@PostConstruct
public void start() throws InterruptedException, KeeperException, IOException,
    IndexNotFoundException, RepositoryException {
  if (linkIndexEnabled) {
    // assure the subscription exists
    sepModel.addSubscriptionSilent("LinkIndexUpdater");
  } else {
    // assure the subscription doesn't exist
    sepModel.removeSubscriptionSilent("LinkIndexUpdater");
  }
  if (linkIndexEnabled) {
    IndexManager indexManager = new IndexManager(hbaseConf, tableFactory);
    LinkIndex linkIndex = new LinkIndex(indexManager, /* TODO multiple repositories */ repositoryManager);
    LinkIndexUpdater linkIndexUpdater = new LinkIndexUpdater(repositoryManager, linkIndex);
    sepConsumer = new SepConsumer("LinkIndexUpdater", 0L, linkIndexUpdater, threads, hostName,
        new ZooKeeperItfAdapter(zk), hbaseConf, new LilyPayloadExtractor());
    sepConsumer.start();
  }
}

代码示例来源:origin: NGDATA/lilyproject

public void setupRepository(String repositoryName) throws Exception {
  if (repositoryManagerSetup) {
    return;
  }
  setupTypeManager();
  if (!repositoryModel.repositoryExistsAndActive(repositoryName)) {
    repositoryModel.create(repositoryName);
    repositoryModel.waitUntilRepositoryInState(repositoryName, RepositoryDefinition.RepositoryLifecycleState
        .ACTIVE, 100000);
  }
  blobStoreAccessFactory = createBlobAccess();
  blobManager = new BlobManagerImpl(hbaseTableFactory, blobStoreAccessFactory, false);
  RecordFactory recordFactory = new RecordFactoryImpl();
  repositoryManager = new HBaseRepositoryManager(typeManager, idGenerator, recordFactory, hbaseTableFactory,
      blobManager, hadoopConf, repositoryModel) {
    @Override
    protected Repository createRepository(RepoTableKey key) throws InterruptedException, RepositoryException {
      HBaseRepository repository = (HBaseRepository)super.createRepository(key);
      repository.setRecordUpdateHooks(recordUpdateHooks);
      return repository;
    }
  };
  sepModel = new SepModelImpl(new ZooKeeperItfAdapter(zk), hadoopConf);
  eventPublisherManager = new LilyEventPublisherManager(hbaseTableFactory);
  tableManager = new TableManagerImpl(repositoryName, hadoopConf, hbaseTableFactory);
  if (!tableManager.tableExists(Table.RECORD.name)) {
    tableManager.createTable(Table.RECORD.name);
  }
  repositoryManagerSetup = true;
}

相关文章