org.apache.gobblin.configuration.State.removePropsWithPrefix()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(83)

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

State.removePropsWithPrefix介绍

[英]Remove all properties with a certain keyPrefix
[中]删除具有特定密钥前缀的所有属性

代码示例

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

/**
 * Remove all lineage related properties from a state
 */
public static void purgeLineageInfo(State state) {
 state.removePropsWithPrefix(LineageEventBuilder.LIENAGE_EVENT_NAMESPACE);
}

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

@Override
public void removePropsWithPrefix(String prefix) {
 super.removePropsWithPrefix(prefix);
 this.workUnit.removePropsWithPrefix(prefix);
 this.jobState.removePropsWithPrefix(prefix);
}

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

@Test
 public void testRemovePropsWithPrefix() {
  final State state = new State();
  final String prefix = "prefix";
  for (int i = 0; i < 10; i++) {
   state.setProp("prefix." + i, i);
  }
  Assert.assertTrue(state.getPropertyNames().size() == 10);
  state.removePropsWithPrefix(prefix);
  Assert.assertTrue(state.getPropertyNames().size() == 0);
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-metrics-base

/**
 * Remove all lineage related properties from a state
 */
public static void purgeLineageInfo(State state) {
 state.removePropsWithPrefix(LineageEventBuilder.LIENAGE_EVENT_NAMESPACE);
}

代码示例来源:origin: org.apache.gobblin/gobblin-api

@Override
public void removePropsWithPrefix(String prefix) {
 super.removePropsWithPrefix(prefix);
 this.workUnit.removePropsWithPrefix(prefix);
 this.jobState.removePropsWithPrefix(prefix);
}

相关文章