gpt4 book ai didi

org.lilyproject.sep.ZooKeeperItfAdapter类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:41:35 28 4
gpt4 key购买 nike

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

ZooKeeperItfAdapter介绍

[英]Adapts a Lily ZooKeeperItf to allow it to be used in the context of the HBase Side-Effect Processor (SEP).
[中]调整Lily ZookeepRef,使其能够在HBase副作用处理器(SEP)的上下文中使用。

代码示例

代码示例来源: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;
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com