org.apache.flink.api.common.operators.util.FieldSet.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(105)

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

FieldSet.<init>介绍

[英]Creates a new empty set of fields.
[中]创建一组新的空字段。

代码示例

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

@Override
public FieldSet getForwardingTargetFields(int input, int sourceField) {
  if (input != 0 && input != 1) {
    throw new IndexOutOfBoundsException("Invalid input index for binary union node.");
  }
  return new FieldSet(sourceField);
}

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

@Override
public FieldSet getForwardingTargetFields(int input, int sourceField) {
  if(input != 0) {
    throw new IndexOutOfBoundsException();
  }
  return new FieldSet(sourceField);
}

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

public FieldSet addField(Integer fieldID) {
  if (fieldID == null) {
    throw new IllegalArgumentException("Field ID must not be null.");
  }
  return new FieldSet(this, fieldID);
}

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

/**
 * Adds a field as having only unique values.
 * 
 * @param field The field with unique values.
 */
public void addUniqueField(int field) {
  if (this.uniqueFields == null) {
    this.uniqueFields = new HashSet<FieldSet>();
  }
  this.uniqueFields.add(new FieldSet(field));
}

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

/**
 * Creates a new node with a single input for the optimizer plan.
 * 
 * @param programOperator The PACT that the node represents.
 */
protected SingleInputNode(SingleInputOperator<?, ?, ?> programOperator) {
  super(programOperator);
  
  int[] k = programOperator.getKeyColumns(0);
  this.keys = k == null || k.length == 0 ? null : new FieldSet(k);
}

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

public PartitionDescriptor(PartitionMethod pMethod, FieldSet pKeys, Ordering ordering, Partitioner<?>
    customPartitioner, DataDistribution distribution) {
  super(pKeys);
  Preconditions.checkArgument(pMethod != PartitionMethod.RANGE
      || pKeys.equals(new FieldSet(ordering.getFieldPositions())),
      "Partition keys must match the given ordering.");
  this.pMethod = pMethod;
  this.customPartitioner = customPartitioner;
  this.distribution = distribution;
  this.ordering = ordering;
}

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

@Test
public void testFieldSetAdds() {
  check(new FieldSet().addField(1).addField(2), 1, 2);
  check(FieldSet.EMPTY_SET.addField(3).addField(2), 3, 2);
  check(new FieldSet(13).addFields(new FieldSet(17, 31, 42)), 17, 13, 42, 31);
  check(new FieldSet(14).addFields(new FieldSet(17)), 17, 14);
  check(new FieldSet(3).addFields(2, 8, 5, 7), 3, 2, 8, 5, 7);
  check(new FieldSet().addFields(new FieldSet()));
  check(new FieldSet().addFields(new FieldSet(3, 4)), 4, 3);
  check(new FieldSet(5, 1).addFields(new FieldSet()), 5, 1);
}

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

@Test(expected = NullPointerException.class)
public void testNullProps() {
  RequestedLocalProperties rlProp = new RequestedLocalProperties();
  rlProp.setGroupedFields(new FieldSet(0, 2, 3));
  rlProp.filterBySemanticProperties(null, 0);
}

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

@Test(expected = IndexOutOfBoundsException.class)
public void testGetReadFieldsInvalidIndex() {
  SingleInputSemanticProperties sp = new SingleInputSemanticProperties();
  sp.addReadFields(new FieldSet(0, 1));
  sp.getReadFields(1);
}

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

@Test
public void testAddSetToList() {
  check(new FieldList().addFields(new FieldSet(1)).addFields(2), 1, 2);
  check(new FieldList().addFields(1).addFields(new FieldSet(2)), 1, 2);
  check(new FieldList().addFields(new FieldSet(2)), 2);
}

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

@Test
public void testAllErased() {
  SingleInputSemanticProperties sProps = new SingleInputSemanticProperties();
  RequestedLocalProperties rlProp = new RequestedLocalProperties();
  rlProp.setGroupedFields(new FieldSet(0, 2, 3));
  RequestedLocalProperties filtered = rlProp.filterBySemanticProperties(sProps, 0);
  assertNull(filtered);
}

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

@Test
public void testEraseAll1() {
  SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
  RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
  rgProps.setAnyPartitioning(new FieldSet(0,1,2));
  RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
  assertNull(filtered);
}

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

@Test(expected = IndexOutOfBoundsException.class)
public void testInvalidInputIndex() {
  SingleInputSemanticProperties sprops = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sprops, new String[]{"0;1"}, null, null, tupleInfo, tupleInfo);
  RequestedGlobalProperties gprops = new RequestedGlobalProperties();
  gprops.setHashPartitioned(new FieldSet(0,1));
  gprops.filterBySemanticProperties(sprops, 1);
}

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

@Test(expected = IndexOutOfBoundsException.class)
public void testInvalidInputIndex() {
  SingleInputSemanticProperties sProps = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sProps, new String[]{"1; 4"}, null, null, tupleInfo, tupleInfo);
  RequestedLocalProperties rlProp = new RequestedLocalProperties();
  rlProp.setGroupedFields(new FieldSet(1, 4));
  rlProp.filterBySemanticProperties(sProps, 1);
}

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

@Test
public void testGroupingErased() {
  SingleInputSemanticProperties sProps = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sProps, new String[]{"0;2"}, null, null, tupleInfo, tupleInfo);
  RequestedLocalProperties rlProp = new RequestedLocalProperties();
  rlProp.setGroupedFields(new FieldSet(0, 2, 3));
  RequestedLocalProperties filtered = rlProp.filterBySemanticProperties(sProps, 0);
  assertNull(filtered);
}

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

@Test
public void testHashPartitioningErased() {
  SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[]{"1;2"}, null, null, tupleInfo, tupleInfo);
  RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
  rgProps.setHashPartitioned(new FieldSet(0, 3, 4));
  RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
  assertNull(filtered);
}

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

@Test
public void testAllErased1() {
  SingleInputSemanticProperties sp = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sp, null, null, null, tupleInfo, tupleInfo);
  LocalProperties lProps = LocalProperties.forGrouping(new FieldList(0, 1, 2));
  lProps = lProps.addUniqueFields(new FieldSet(3,4));
  lProps = lProps.addUniqueFields(new FieldSet(5,6));
  LocalProperties filtered = lProps.filterBySemanticProperties(sp, 0);
  assertNull(filtered.getGroupedFields());
  assertNull(filtered.getOrdering());
  assertNull(filtered.getUniqueFields());
}

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

@Test
public void testEraseAll2() {
  SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[]{"3;4"}, null, null, tupleInfo, tupleInfo);
  RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
  rgProps.setAnyPartitioning(new FieldSet(0, 1, 2));
  RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
  assertNull(filtered);
}

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

@Test
public void testCustomPartitioningErased() {
  SingleInputSemanticProperties sProp = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sProp, new String[]{"0;1;2"}, null, null, tupleInfo, tupleInfo);
  RequestedGlobalProperties rgProps = new RequestedGlobalProperties();
  rgProps.setCustomPartitioned(new FieldSet(0, 1, 2), new MockPartitioner());
  RequestedGlobalProperties filtered = rgProps.filterBySemanticProperties(sProp, 0);
  assertNull(filtered);
}

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

@Test
public void testAllErased2() {
  SingleInputSemanticProperties sp = new SingleInputSemanticProperties();
  SemanticPropUtil.getSemanticPropsSingleFromString(sp, new String[]{"5"}, null, null, tupleInfo, tupleInfo);
  LocalProperties lProps = LocalProperties.forGrouping(new FieldList(0, 1, 2));
  lProps = lProps.addUniqueFields(new FieldSet(3,4));
  LocalProperties filtered = lProps.filterBySemanticProperties(sp, 0);
  assertNull(filtered.getGroupedFields());
  assertNull(filtered.getOrdering());
  assertNull(filtered.getUniqueFields());
}

相关文章