public class TestingReaderContext extends Object implements SourceReaderContext
SourceReaderContext
.Constructor and Description |
---|
TestingReaderContext() |
TestingReaderContext(Configuration config,
SourceReaderMetricGroup metricGroup) |
Modifier and Type | Method and Description |
---|---|
void |
clearSentEvents() |
int |
currentParallelism()
Get the current parallelism of this Source.
|
Configuration |
getConfiguration()
Gets the configuration with which Flink was started.
|
int |
getIndexOfSubtask() |
String |
getLocalHostName()
Gets the hostname of the machine where this reader is executed.
|
int |
getNumSplitRequests() |
List<SourceEvent> |
getSentEvents() |
UserCodeClassLoader |
getUserCodeClassLoader()
Gets the
UserCodeClassLoader to load classes that are not in system's classpath, but
are part of the jar file of a user job. |
SourceReaderMetricGroup |
metricGroup() |
void |
sendSourceEventToCoordinator(SourceEvent sourceEvent)
Send a source event to the source coordinator.
|
void |
sendSplitRequest()
Sends a split request to the source's
SplitEnumerator . |
public TestingReaderContext()
public TestingReaderContext(Configuration config, SourceReaderMetricGroup metricGroup)
public SourceReaderMetricGroup metricGroup()
metricGroup
in interface SourceReaderContext
public Configuration getConfiguration()
SourceReaderContext
getConfiguration
in interface SourceReaderContext
public String getLocalHostName()
SourceReaderContext
getLocalHostName
in interface SourceReaderContext
public int getIndexOfSubtask()
getIndexOfSubtask
in interface SourceReaderContext
public void sendSplitRequest()
SourceReaderContext
SplitEnumerator
. This will result in a call to
the SplitEnumerator.handleSplitRequest(int, String)
method, with this reader's
parallel subtask id and the hostname where this reader runs.sendSplitRequest
in interface SourceReaderContext
public void sendSourceEventToCoordinator(SourceEvent sourceEvent)
SourceReaderContext
sendSourceEventToCoordinator
in interface SourceReaderContext
sourceEvent
- the source event to coordinator.public UserCodeClassLoader getUserCodeClassLoader()
SourceReaderContext
UserCodeClassLoader
to load classes that are not in system's classpath, but
are part of the jar file of a user job.getUserCodeClassLoader
in interface SourceReaderContext
UserCodeClassLoader
public int currentParallelism()
SourceReaderContext
currentParallelism
in interface SourceReaderContext
public int getNumSplitRequests()
public List<SourceEvent> getSentEvents()
public void clearSentEvents()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.