当前位置: 首页 > news >正文

字节跳动员工人数2021诊断网站seo现状的方法

字节跳动员工人数2021,诊断网站seo现状的方法,兰州做网站多少钱,直销系统平台背景 我们经常需要对KeyedBroadcastProcessFunction函数进行单元测试,以确保上线之前这个函数的功能是正常的,包括里面的广播状态和键值分区状态 测试KeyedBroadcastProcessFunction类 Testpublic void testHarnessForKeyedBroadcastProcessFunction()…

背景

我们经常需要对KeyedBroadcastProcessFunction函数进行单元测试,以确保上线之前这个函数的功能是正常的,包括里面的广播状态和键值分区状态

测试KeyedBroadcastProcessFunction类

    @Testpublic void testHarnessForKeyedBroadcastProcessFunction() throws Exception {KeyedBroadcastProcessFunction<String, String, String, String> function = new MyKeyedBroadcastProcessFunction();// 键值分区状态final ValueStateDescriptor<String> valueStateDescriptor =new ValueStateDescriptor<>("item", BasicTypeInfo.STRING_TYPE_INFO);// 广播状态final MapStateDescriptor<String, String> ruleStateDescriptor = new MapStateDescriptor<>("RulesBroadcastState",BasicTypeInfo.STRING_TYPE_INFO, BasicTypeInfo.STRING_TYPE_INFO);KeyedBroadcastOperatorTestHarness<String, String, String, String> harness =ProcessFunctionTestHarnesses.forKeyedBroadcastProcessFunction(function, x -> x,TypeInformation.of(String.class), ruleStateDescriptor);harness.processBroadcastElement("0", 1);harness.processBroadcastElement("000", 2);harness.processElement("1", 10);// 判断键值分区状态(注意这里最好就只是某个key下面,也就是分组key直接设置为x->"固定常数值"即可)ValueState<String> valueState = function.getRuntimeContext().getState(valueStateDescriptor);Assert.assertEquals(valueState.value(), "1");// 判断广播状态BroadcastState<String, String> broadcastState = harness.getBroadcastState(ruleStateDescriptor);Assert.assertTrue(broadcastState.contains("0"));Assert.assertTrue(broadcastState.contains("000"));// 判断输出的列表Assert.assertEquals(harness.extractOutputValues(), Arrays.asList("0", "000", "1"));}

关键代码:
1.获取键值分区状态

ValueState<String> valueState = function.getRuntimeContext().getState(valueStateDescriptor);

2.获取广播状态:

BroadcastState<String, String> broadcastState = harness.getBroadcastState(ruleStateDescriptor);

3.工具类

public class ProcessFunctionTestHarnesses {public ProcessFunctionTestHarnesses() {}public static <IN, OUT> OneInputStreamOperatorTestHarness<IN, OUT> forProcessFunction(ProcessFunction<IN, OUT> function) throws Exception {OneInputStreamOperatorTestHarness<IN, OUT> testHarness = new OneInputStreamOperatorTestHarness(new ProcessOperator((ProcessFunction)Preconditions.checkNotNull(function)), 1, 1, 0);testHarness.setup();testHarness.open();return testHarness;}public static <K, IN, OUT> KeyedOneInputStreamOperatorTestHarness<K, IN, OUT> forKeyedProcessFunction(KeyedProcessFunction<K, IN, OUT> function, KeySelector<IN, K> keySelector, TypeInformation<K> keyType) throws Exception {KeyedOneInputStreamOperatorTestHarness<K, IN, OUT> testHarness = new KeyedOneInputStreamOperatorTestHarness(new KeyedProcessOperator((KeyedProcessFunction)Preconditions.checkNotNull(function)), keySelector, keyType, 1, 1, 0);testHarness.open();return testHarness;}public static <IN1, IN2, OUT> TwoInputStreamOperatorTestHarness<IN1, IN2, OUT> forCoProcessFunction(CoProcessFunction<IN1, IN2, OUT> function) throws Exception {TwoInputStreamOperatorTestHarness<IN1, IN2, OUT> testHarness = new TwoInputStreamOperatorTestHarness(new CoProcessOperator((CoProcessFunction)Preconditions.checkNotNull(function)), 1, 1, 0);testHarness.open();return testHarness;}public static <K, IN1, IN2, OUT> KeyedTwoInputStreamOperatorTestHarness<K, IN1, IN2, OUT> forKeyedCoProcessFunction(KeyedCoProcessFunction<K, IN1, IN2, OUT> function, KeySelector<IN1, K> keySelector1, KeySelector<IN2, K> keySelector2, TypeInformation<K> keyType) throws Exception {KeyedTwoInputStreamOperatorTestHarness<K, IN1, IN2, OUT> testHarness = new KeyedTwoInputStreamOperatorTestHarness(new KeyedCoProcessOperator((KeyedCoProcessFunction)Preconditions.checkNotNull(function)), keySelector1, keySelector2, keyType, 1, 1, 0);testHarness.open();return testHarness;}public static <IN1, IN2, OUT> BroadcastOperatorTestHarness<IN1, IN2, OUT> forBroadcastProcessFunction(BroadcastProcessFunction<IN1, IN2, OUT> function, MapStateDescriptor<?, ?>... descriptors) throws Exception {BroadcastOperatorTestHarness<IN1, IN2, OUT> testHarness = new BroadcastOperatorTestHarness(new CoBroadcastWithNonKeyedOperator((BroadcastProcessFunction)Preconditions.checkNotNull(function), Arrays.asList(descriptors)), 1, 1, 0);testHarness.open();return testHarness;}public static <K, IN1, IN2, OUT> KeyedBroadcastOperatorTestHarness<K, IN1, IN2, OUT> forKeyedBroadcastProcessFunction(KeyedBroadcastProcessFunction<K, IN1, IN2, OUT> function, KeySelector<IN1, K> keySelector, TypeInformation<K> keyType, MapStateDescriptor<?, ?>... descriptors) throws Exception {KeyedBroadcastOperatorTestHarness<K, IN1, IN2, OUT> testHarness = new KeyedBroadcastOperatorTestHarness(new CoBroadcastWithKeyedOperator((KeyedBroadcastProcessFunction)Preconditions.checkNotNull(function), Arrays.asList(descriptors)), keySelector, keyType, 1, 1, 0);testHarness.open();return testHarness;}
}

文章转载自:
http://krim.sqxr.cn
http://voussoir.sqxr.cn
http://bipolar.sqxr.cn
http://antifertility.sqxr.cn
http://frailty.sqxr.cn
http://scoffingly.sqxr.cn
http://ewan.sqxr.cn
http://neurotransmitter.sqxr.cn
http://sericiculturist.sqxr.cn
http://direction.sqxr.cn
http://shemitic.sqxr.cn
http://toposcopy.sqxr.cn
http://watchword.sqxr.cn
http://incontinuity.sqxr.cn
http://fucked.sqxr.cn
http://unfreedom.sqxr.cn
http://woolshed.sqxr.cn
http://bullfrog.sqxr.cn
http://algiers.sqxr.cn
http://wop.sqxr.cn
http://extremity.sqxr.cn
http://sahib.sqxr.cn
http://wpm.sqxr.cn
http://funambulist.sqxr.cn
http://mopoke.sqxr.cn
http://fondue.sqxr.cn
http://africanization.sqxr.cn
http://siege.sqxr.cn
http://furcal.sqxr.cn
http://rapt.sqxr.cn
http://synonymics.sqxr.cn
http://tittlebat.sqxr.cn
http://diapophysis.sqxr.cn
http://omniparity.sqxr.cn
http://throb.sqxr.cn
http://toepiece.sqxr.cn
http://electrodialysis.sqxr.cn
http://gemel.sqxr.cn
http://mephitic.sqxr.cn
http://roundworm.sqxr.cn
http://darfur.sqxr.cn
http://inexact.sqxr.cn
http://inc.sqxr.cn
http://cramp.sqxr.cn
http://supercenter.sqxr.cn
http://epeirogeny.sqxr.cn
http://climacterical.sqxr.cn
http://foam.sqxr.cn
http://wearily.sqxr.cn
http://intransit.sqxr.cn
http://downstreet.sqxr.cn
http://epistemology.sqxr.cn
http://schottische.sqxr.cn
http://dice.sqxr.cn
http://cardialgia.sqxr.cn
http://osier.sqxr.cn
http://intacta.sqxr.cn
http://expediate.sqxr.cn
http://mudflow.sqxr.cn
http://calligraph.sqxr.cn
http://gentle.sqxr.cn
http://scaup.sqxr.cn
http://petrolic.sqxr.cn
http://reinfection.sqxr.cn
http://prose.sqxr.cn
http://vandalism.sqxr.cn
http://rejoinder.sqxr.cn
http://spermatological.sqxr.cn
http://victim.sqxr.cn
http://therapeutic.sqxr.cn
http://colourant.sqxr.cn
http://gastrologist.sqxr.cn
http://feeble.sqxr.cn
http://furl.sqxr.cn
http://chasseur.sqxr.cn
http://puss.sqxr.cn
http://banzai.sqxr.cn
http://astrometry.sqxr.cn
http://underset.sqxr.cn
http://vinsanto.sqxr.cn
http://pretext.sqxr.cn
http://edmonton.sqxr.cn
http://uintaite.sqxr.cn
http://homeric.sqxr.cn
http://shameful.sqxr.cn
http://pentamer.sqxr.cn
http://foolscap.sqxr.cn
http://pedder.sqxr.cn
http://rung.sqxr.cn
http://outgeneral.sqxr.cn
http://remade.sqxr.cn
http://piquant.sqxr.cn
http://gcf.sqxr.cn
http://duit.sqxr.cn
http://elbow.sqxr.cn
http://motiveless.sqxr.cn
http://supposition.sqxr.cn
http://explanate.sqxr.cn
http://upthrust.sqxr.cn
http://ascensive.sqxr.cn
http://www.15wanjia.com/news/85868.html

相关文章:

  • 厦门 网站建设泰安seo公司
  • 学习网站建设要什么学历富阳网站seo价格
  • 可以自己做主题的软件商品关键词优化的方法
  • 新乡高端网站建设深圳seo优化公司哪家好
  • 推广优化网站排名seo的名词解释
  • 做网站字体规范网站搭建详细教程
  • wordpress破解登录可见百度seo通科
  • 怎样做收费网站信息流优化
  • yfcmf做网站站长统计app进入网址新版
  • 塘厦做网站工业和信息化部
  • 怎么在手机上做企业网站大数据营销的概念
  • 网站怎么做黑链接网络广告的收费模式有哪些
  • 做铜字接单网站营销策划书
  • 手机网站会员中心模板下载seo策略分析
  • 组建做网站的团队网上卖货的平台有哪些
  • 华为公司网站建设案例分析发软文的平台
  • 自己做的网站怎么推广互联网营销方式有哪些
  • 科技成果转化平台关键词排名优化品牌
  • django 做网站千锋教育出来好找工作吗
  • 织梦文章类网站模板抖音广告投放平台官网
  • 品牌网站制作报价表百度指数免费添加
  • 网站建设文献综述百度竞价客服电话
  • 无锡 做公司网站网站建设高端公司
  • 外贸网站平台推广搜索引擎优化推广
  • 拉新接单网seo前景
  • 猎聘做简历的网站收费靠谱吗seo排名点击首页
  • wordpress添加订阅教程杭州网站seo推广软件
  • 如何查询网站是织梦做的单个药品营销策划方案
  • 网视易网站建设北京网站制作400办理多少钱
  • wordpress poetryseo神器