gpt4 book ai didi

org.I0Itec.zkclient.ZkClient.setZkSerializer()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 11:24:40 28 4
gpt4 key购买 nike

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

ZkClient.setZkSerializer介绍

暂无

代码示例

代码示例来源:origin: apache/nifi

zkClient.setZkSerializer(new ZkSerializer() {
  @Override
  public byte[] serialize(Object o) throws ZkMarshallingError {

代码示例来源:origin: apache/incubator-pinot

public DynamicBrokerSelector(String zkServers) {
 ZkClient zkClient = new ZkClient(zkServers);
 zkClient.setZkSerializer(new BytesPushThroughSerializer());
 zkClient.waitUntilConnected(60, TimeUnit.SECONDS);
 zkClient.subscribeDataChanges(ExternalViewReader.BROKER_EXTERNAL_VIEW_PATH, this);
 evReader = new ExternalViewReader(zkClient);
 refresh();
}

代码示例来源:origin: javachen/learning-hadoop

public static void main(String[] args) {
  loadProperties();
  ZkClient client = new ZkClient(ZK_ADDRESS, ZK_TIMEOUT);
  client.setZkSerializer(new ZkUtils.StringSerializer(ZK_CONF_ENCODING));
  File confDir = new File(CONF_DIR);
  if ((!confDir.exists()) || (!confDir.isDirectory())) {
    System.err.println("错误: 配置目录" + confDir + "不存在或非法! ");
    System.exit(1);
  }
  publishConfigs(client, ZK_CONFIG_ROOTNODE, confDir);
}

代码示例来源:origin: javachen/learning-hadoop

public static void main(String[] args) {
  if ((args == null) || (args.length < 1)) {
    throw new RuntimeException("需要指定输出目录名");
  }
  loadProperties();
  ZkClient client = new ZkClient(ZK_ADDRESS, ZK_TIMEOUT);
  client.setZkSerializer(new ZkUtils.StringSerializer(ZK_CONF_ENCODING));
  File confDir = new File(args[0]);
  confDir.mkdirs();
  saveConfigs(client, ZK_CONFIG_ROOTNODE, confDir);
}

代码示例来源:origin: homeaway/stream-registry

private ZkUtils initZkUtils(Properties config) {
  String zkConnect = config.getProperty(KafkaProducerConfig.ZOOKEEPER_QUORUM);
  ZkClient zkClient = new ZkClient(zkConnect);
  zkClient.setZkSerializer(ZKStringSerializer$.MODULE$);
  ZkConnection zkConnection = new ZkConnection(zkConnect);
  ZkUtils zkUtils = new ZkUtils(zkClient, zkConnection, false);
  return zkUtils;
}

代码示例来源:origin: youtongluan/sumk

zk.setZkSerializer(new ZkSerializer() {

代码示例来源:origin: org.apache.nifi/nifi-kafka-processors

zkClient.setZkSerializer(new ZkSerializer() {
  @Override
  public byte[] serialize(Object o) throws ZkMarshallingError {

代码示例来源:origin: org.apache.nifi/nifi-kafka-0-8-processors

zkClient.setZkSerializer(new ZkSerializer() {
  @Override
  public byte[] serialize(Object o) throws ZkMarshallingError {

代码示例来源:origin: apache/helix

public static void main(String[] args) throws Exception {
 setup();
 zkServer.getZkClient().setZkSerializer(new ZNRecordSerializer());
 ZNRecord record = zkServer.getZkClient().readData(PropertyPathBuilder.idealState(clusterName, "TestDB"));
 String externalViewPath = PropertyPathBuilder.externalView(clusterName, "TestDB");
 MockSpectatorProcess process = new MockSpectatorProcess();
 process.start();
 // try to route, there is no master or slave available
 process.routeRequest("TestDB", "TestDB_1");
 // update the externalview on zookeeper
 zkServer.getZkClient().createPersistent(externalViewPath, record);
 // sleep for sometime so that the ZK Callback is received.
 Thread.sleep(1000);
 process.routeRequest("TestDB", "TestDB_1");
 System.exit(1);
}

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