org.apache.flink.optimizer.dag.DataSourceNode Java Examples

The following examples show how to use org.apache.flink.optimizer.dag.DataSourceNode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChannelTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesWithReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	final int REPLICATION = 23;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);
	channel.setReplicationFactor(REPLICATION);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE * REPLICATION, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD * REPLICATION, channel.getEstimatedNumRecords());
}
 
Example #2
Source File: ChannelTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesNoReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD, channel.getEstimatedNumRecords());
}
 
Example #3
Source File: ChannelTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesNoReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD, channel.getEstimatedNumRecords());
}
 
Example #4
Source File: ChannelTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesWithReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	final int REPLICATION = 23;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);
	channel.setReplicationFactor(REPLICATION);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE * REPLICATION, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD * REPLICATION, channel.getEstimatedNumRecords());
}
 
Example #5
Source File: ChannelTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesNoReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD, channel.getEstimatedNumRecords());
}
 
Example #6
Source File: ChannelTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetEstimatesWithReplicationFactor() {
	final long NUM_RECORD = 1001;
	final long SIZE = 467131;
	
	final int REPLICATION = 23;
	
	DataSourceNode source = getSourceNode();
	SourcePlanNode planNode = new SourcePlanNode(source, "test node");
	Channel channel = new Channel(planNode);
	channel.setReplicationFactor(REPLICATION);

	// no estimates here
	Assert.assertEquals(-1, channel.getEstimatedOutputSize());
	Assert.assertEquals(-1, channel.getEstimatedNumRecords());
	
	// set estimates
	source.setEstimatedNumRecords(NUM_RECORD);
	source.setEstimatedOutputSize(SIZE);
	Assert.assertEquals(SIZE * REPLICATION, channel.getEstimatedOutputSize());
	Assert.assertEquals(NUM_RECORD * REPLICATION, channel.getEstimatedNumRecords());
}
 
Example #7
Source File: SourcePlanNode.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public SourcePlanNode(DataSourceNode template, String nodeName, GlobalProperties gprops, LocalProperties lprops) {
	super(template, nodeName, DriverStrategy.NONE);

	this.globalProps = gprops;
	this.localProps = lprops;
	updatePropertiesWithUniqueSets(template.getUniqueFields());
}
 
Example #8
Source File: SourcePlanNode.java    From flink with Apache License 2.0 5 votes vote down vote up
public SourcePlanNode(DataSourceNode template, String nodeName, GlobalProperties gprops, LocalProperties lprops) {
	super(template, nodeName, DriverStrategy.NONE);

	this.globalProps = gprops;
	this.localProps = lprops;
	updatePropertiesWithUniqueSets(template.getUniqueFields());
}
 
Example #9
Source File: SourcePlanNode.java    From flink with Apache License 2.0 5 votes vote down vote up
public SourcePlanNode(DataSourceNode template, String nodeName, GlobalProperties gprops, LocalProperties lprops) {
	super(template, nodeName, DriverStrategy.NONE);

	this.globalProps = gprops;
	this.localProps = lprops;
	updatePropertiesWithUniqueSets(template.getUniqueFields());
}
 
Example #10
Source File: ChannelTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private static final DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(
			new TextInputFormat(new Path("/ignored")), 
			new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO),
			"source"));
}
 
Example #11
Source File: FeedbackPropertiesMatchTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private static DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(new TextInputFormat(new Path("/")), new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO)));
}
 
Example #12
Source File: SourcePlanNode.java    From flink with Apache License 2.0 4 votes vote down vote up
public DataSourceNode getDataSourceNode() {
	return (DataSourceNode) this.template;
}
 
Example #13
Source File: ChannelTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private static final DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(
			new TextInputFormat(new Path("/ignored")), 
			new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO),
			"source"));
}
 
Example #14
Source File: FeedbackPropertiesMatchTest.java    From flink with Apache License 2.0 4 votes vote down vote up
private static DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(new TextInputFormat(new Path("/")), new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO)));
}
 
Example #15
Source File: SourcePlanNode.java    From flink with Apache License 2.0 4 votes vote down vote up
public DataSourceNode getDataSourceNode() {
	return (DataSourceNode) this.template;
}
 
Example #16
Source File: ChannelTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private static final DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(
			new TextInputFormat(new Path("/ignored")), 
			new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO),
			"source"));
}
 
Example #17
Source File: FeedbackPropertiesMatchTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private static DataSourceNode getSourceNode() {
	return new DataSourceNode(new GenericDataSourceBase<String, TextInputFormat>(new TextInputFormat(new Path("/")), new OperatorInformation<String>(BasicTypeInfo.STRING_TYPE_INFO)));
}
 
Example #18
Source File: SourcePlanNode.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public DataSourceNode getDataSourceNode() {
	return (DataSourceNode) this.template;
}
 
Example #19
Source File: SourcePlanNode.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs a new source candidate node that uses <i>NONE</i> as its local strategy.
 * 
 * @param template The template optimizer node that this candidate is created for.
 */
public SourcePlanNode(DataSourceNode template, String nodeName) {
	this(template, nodeName, new GlobalProperties(), new LocalProperties());
}
 
Example #20
Source File: SourcePlanNode.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs a new source candidate node that uses <i>NONE</i> as its local strategy.
 * 
 * @param template The template optimizer node that this candidate is created for.
 */
public SourcePlanNode(DataSourceNode template, String nodeName) {
	this(template, nodeName, new GlobalProperties(), new LocalProperties());
}
 
Example #21
Source File: SourcePlanNode.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs a new source candidate node that uses <i>NONE</i> as its local strategy.
 * 
 * @param template The template optimizer node that this candidate is created for.
 */
public SourcePlanNode(DataSourceNode template, String nodeName) {
	this(template, nodeName, new GlobalProperties(), new LocalProperties());
}