gpt4 book ai didi

com.bazaarvoice.emodb.common.zookeeper.store.ZkTimestampSerializer.fromString()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 17:25:31 26 4
gpt4 key购买 nike

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

ZkTimestampSerializer.fromString介绍

暂无

代码示例

代码示例来源:origin: com.bazaarvoice.emodb/emodb-sor

@Override
  public StashRunTimeInfo fromString(String string) {
    if (string == null) {
      return null;
    }
    try {
      List<String> strings = Arrays.asList(StringUtils.split(string, ";"));
      Long timestamp = TIMESTAMP_SERIALIZER.fromString(strings.get(0));
      String dataCenter = strings.get(1);
      Long expiredTimestamp = TIMESTAMP_SERIALIZER.fromString(strings.get(2));
      List<String> placements = Arrays.asList(StringUtils.split(strings.get(3), ","));

      return new StashRunTimeInfo(timestamp, placements, dataCenter, expiredTimestamp);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("StashRunTimeInfo string must be of the form \"timestamp;datacenter;remote;placement1,placement2,placement3,...\"");
    }
  }
}

代码示例来源:origin: bazaarvoice/emodb

@Override
  public StashRunTimeInfo fromString(String string) {
    if (string == null) {
      return null;
    }
    try {
      List<String> strings = Arrays.asList(StringUtils.split(string, ";"));
      Long timestamp = TIMESTAMP_SERIALIZER.fromString(strings.get(0));
      String dataCenter = strings.get(1);
      Long expiredTimestamp = TIMESTAMP_SERIALIZER.fromString(strings.get(2));
      List<String> placements = Arrays.asList(StringUtils.split(strings.get(3), ","));

      return new StashRunTimeInfo(timestamp, placements, dataCenter, expiredTimestamp);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("StashRunTimeInfo string must be of the form \"timestamp;datacenter;remote;placement1,placement2,placement3,...\"");
    }
  }
}

代码示例来源:origin: bazaarvoice/emodb

@Override
  public AdHocThrottle fromString(String string) {
    if (string == null) {
      return null;
    }
    try {
      int comma = string.indexOf(",");
      int limit = Integer.parseInt(string.substring(0, comma));
      Instant expiration = Instant.ofEpochMilli(TIMESTAMP_SERIALIZER.fromString(string.substring(comma + 1)));
      return AdHocThrottle.create(limit, expiration);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("Throttle string must be of the form \"limit,expiration date\"");
    }
  }
}

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