method2testcases
stringlengths
118
6.63k
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { static ResourceID extractResourceID(Protos.TaskID taskId) { return new ResourceID(taskId.getValue()); } MesosResourceManager( // base class RpcService rpcService, String resourceManagerEndpointId, ResourceID resourceId, ...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { public void acceptOffers(AcceptOffers msg) { try { List<TaskMonitor.TaskGoalStateUpdated> toMonitor = new ArrayList<>(msg.operations().size()); for (Protos.Offer.Operation op : msg.operations()) { if (op.getType() == Protos.Offer.Op...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { protected void statusUpdate(StatusUpdate message) { taskMonitor.tell(message, selfActor); reconciliationCoordinator.tell(message, selfActor); schedulerDriver.acknowledgeStatusUpdate(message.status()); } MesosResourceManager( // b...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { @Override protected RegisteredMesosWorkerNode workerStarted(ResourceID resourceID) { MesosWorkerStore.Worker inLaunch = workersInLaunch.get(resourceID); if (inLaunch != null) { return new RegisteredMesosWorkerNode(inLaunch); } else ...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { @Override public boolean stopWorker(RegisteredMesosWorkerNode workerNode) { LOG.info("Stopping worker {}.", workerNode.getResourceID()); try { if (workersInLaunch.containsKey(workerNode.getResourceID())) { MesosWorkerStore.Worker wo...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { protected void registered(Registered message) { connectionMonitor.tell(message, selfActor); try { workerStore.setFrameworkID(Option.apply(message.frameworkId())); } catch (Exception ex) { onFatalError(new ResourceManagerException("U...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { protected void reregistered(ReRegistered message) { connectionMonitor.tell(message, selfActor); launchCoordinator.tell(message, selfActor); reconciliationCoordinator.tell(message, selfActor); taskMonitor.tell(message, selfActor); } ...
### Question: MesosResourceManager extends ResourceManager<RegisteredMesosWorkerNode> { protected void disconnected(Disconnected message) { connectionMonitor.tell(message, selfActor); launchCoordinator.tell(message, selfActor); reconciliationCoordinator.tell(message, selfActor); taskMonitor.tell(message, selfActor); } ...
### Question: MesosTaskManagerParameters { public List<Protos.Volume> containerVolumes() { return containerVolumes; } MesosTaskManagerParameters( double cpus, int gpus, ContainerType containerType, Option<String> containerImageName, ContaineredTaskManagerParameters containeredParameters, List<Protos.V...
### Question: Offer implements VirtualMachineLease { @Override public double cpuCores() { return cpuCores; } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Override double...
### Question: Offer implements VirtualMachineLease { public double gpus() { return getScalarValue("gpus"); } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Override double...
### Question: Offer implements VirtualMachineLease { @Override public double memoryMB() { return memoryMB; } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Override double...
### Question: Offer implements VirtualMachineLease { @Override public double networkMbps() { return networkMbps; } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Override ...
### Question: Offer implements VirtualMachineLease { @Override public double diskMB() { return diskMB; } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Override double net...
### Question: Offer implements VirtualMachineLease { @Override public List<Range> portRanges() { return portRanges; } Offer(Protos.Offer offer); List<Protos.Resource> getResources(); @Override String hostname(); @Override String getVMID(); @Override double cpuCores(); double gpus(); @Override double memoryMB(); @Overri...
### Question: RegisterApplicationMasterResponseReflector { @VisibleForTesting List<Container> getContainersFromPreviousAttemptsUnsafe(final Object response) { if (method != null && response != null) { try { @SuppressWarnings("unchecked") final List<Container> containers = (List<Container>) method.invoke(response); if (...
### Question: RegisterApplicationMasterResponseReflector { @VisibleForTesting Method getMethod() { return method; } RegisterApplicationMasterResponseReflector(final Logger log); @VisibleForTesting RegisterApplicationMasterResponseReflector(final Logger log, final Class<?> clazz); }### Answer: @Test public void testG...
### Question: Utils { public static void deleteApplicationFiles(final Map<String, String> env) { final String applicationFilesDir = env.get(YarnConfigKeys.FLINK_YARN_FILES); if (!StringUtils.isNullOrWhitespaceOnly(applicationFilesDir)) { final org.apache.flink.core.fs.Path path = new org.apache.flink.core.fs.Path(appli...
### Question: PrometheusReporter implements MetricReporter { @VisibleForTesting int getPort() { Preconditions.checkState(httpServer != null, "Server has not been initialized."); return port; } @Override void open(MetricConfig config); @Override void close(); @Override void notifyOfAddedMetric(final Metric metric, fina...
### Question: JarIdPathParameter extends MessagePathParameter<String> { @Override protected String convertFromString(final String value) throws ConversionException { final Path path = Paths.get(value); if (path.getParent() != null) { throw new ConversionException(String.format("%s must be a filename only (%s)", KEY, pa...
### Question: ListStateDescriptor extends StateDescriptor<ListState<T>, List<T>> { public ListStateDescriptor(String name, Class<T> elementTypeClass) { super(name, new ListTypeInfo<>(elementTypeClass), null); } ListStateDescriptor(String name, Class<T> elementTypeClass); ListStateDescriptor(String name, TypeInformatio...
### Question: ListStateDescriptor extends StateDescriptor<ListState<T>, List<T>> { public TypeSerializer<T> getElementSerializer() { final TypeSerializer<List<T>> rawSerializer = getSerializer(); if (!(rawSerializer instanceof ListSerializer)) { throw new IllegalStateException(); } return ((ListSerializer<T>) rawSerial...
### Question: StateDescriptor implements Serializable { public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } } protected StateDescriptor(String name, TypeSerializer<T> serializer, @Nullable T d...
### Question: ReducingStateDescriptor extends StateDescriptor<ReducingState<T>, T> { public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, Class<T> typeClass) { super(name, typeClass, null); this.reduceFunction = checkNotNull(reduceFunction); if (reduceFunction instanceof RichFunction) { throw n...
### Question: MapStateDescriptor extends StateDescriptor<MapState<UK, UV>, Map<UK, UV>> { public MapStateDescriptor(String name, TypeSerializer<UK> keySerializer, TypeSerializer<UV> valueSerializer) { super(name, new MapSerializer<>(keySerializer, valueSerializer), null); } MapStateDescriptor(String name, TypeSerialize...
### Question: JarIdPathParameter extends MessagePathParameter<String> { @Override protected String convertToString(final String value) { return value; } protected JarIdPathParameter(); static final String KEY; }### Answer: @Test public void testConvertToString() throws Exception { final String expected = "test.jar"; ...
### Question: ResourceSpec implements Serializable { public boolean isValid() { if (this.cpuCores >= 0 && this.heapMemoryInMB >= 0 && this.directMemoryInMB >= 0 && this.nativeMemoryInMB >= 0 && this.stateSizeInMB >= 0) { for (Resource resource : extendedResources.values()) { if (resource.getValue() < 0) { return false;...
### Question: ResourceSpec implements Serializable { public boolean lessThanOrEqual(@Nonnull ResourceSpec other) { int cmp1 = Double.compare(this.cpuCores, other.cpuCores); int cmp2 = Integer.compare(this.heapMemoryInMB, other.heapMemoryInMB); int cmp3 = Integer.compare(this.directMemoryInMB, other.directMemoryInMB); i...
### Question: JarDeleteHandler extends AbstractRestHandler<RestfulGateway, EmptyRequestBody, EmptyResponseBody, JarDeleteMessageParameters> { @Override protected CompletableFuture<EmptyResponseBody> handleRequest( @Nonnull final HandlerRequest<EmptyRequestBody, JarDeleteMessageParameters> request, @Nonnull final Restfu...
### Question: ResourceSpec implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceSpec.class) { ResourceSpec that = (ResourceSpec) obj; return this.cpuCores == that.cpuCores && this.heapMemoryInMB == that.heapMemoryInMB...
### Question: ResourceSpec implements Serializable { @Override public int hashCode() { final long cpuBits = Double.doubleToLongBits(cpuCores); int result = (int) (cpuBits ^ (cpuBits >>> 32)); result = 31 * result + heapMemoryInMB; result = 31 * result + directMemoryInMB; result = 31 * result + nativeMemoryInMB; result ...
### Question: ResourceSpec implements Serializable { public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB...
### Question: ResourceSpec implements Serializable { public static Builder newBuilder() { return new Builder(); } protected ResourceSpec( double cpuCores, int heapMemoryInMB, int directMemoryInMB, int nativeMemoryInMB, int stateSizeInMB, Resource... extendedResources); ResourceSpec merge(ResourceSpec...
### Question: ParallelismQueryParameter extends MessageQueryParameter<Integer> { @Override public Integer convertStringToValue(final String value) { return Integer.valueOf(value); } ParallelismQueryParameter(); @Override Integer convertStringToValue(final String value); @Override String convertValueToString(final Integ...
### Question: JarHandlerUtils { public static List<String> tokenizeArguments(@Nullable final String args) { if (args == null) { return Collections.emptyList(); } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN.matcher(args); final List<String> tokens = new ArrayList<>(); while (matcher.find()) { tokens.add(matcher.g...
### Question: ExecutionConfig implements Serializable, Archiveable<ArchivedExecutionConfig> { public void disableGenericTypes() { disableGenericTypes = true; } ExecutionConfig enableClosureCleaner(); ExecutionConfig disableClosureCleaner(); boolean isClosureCleanerEnabled(); @PublicEvolving ExecutionConfig setAutoWate...
### Question: LocalFileSystem extends FileSystem { @Override public boolean rename(final Path src, final Path dst) throws IOException { final File srcFile = pathToFile(src); final File dstFile = pathToFile(dst); final File dstParent = dstFile.getParentFile(); dstParent.mkdirs(); try { Files.move(srcFile.toPath(), dstFi...
### Question: LocalFileSystem extends FileSystem { @Override public FileSystemKind getKind() { return FileSystemKind.FILE_SYSTEM; } LocalFileSystem(); @Override BlockLocation[] getFileBlockLocations(FileStatus file, long start, long len); @Override FileStatus getFileStatus(Path f); @Override URI getUri(); @Override Pat...
### Question: JarUploadHandler extends AbstractRestHandler<RestfulGateway, FileUpload, JarUploadResponseBody, EmptyMessageParameters> { @Override protected CompletableFuture<JarUploadResponseBody> handleRequest( @Nonnull final HandlerRequest<FileUpload, EmptyMessageParameters> request, @Nonnull final RestfulGateway g...
### Question: JsonRowSerializationSchema implements SerializationSchema<Row> { @Override public byte[] serialize(Row row) { if (node == null) { node = mapper.createObjectNode(); } try { convertRow(node, (RowTypeInfo) typeInfo, row); return mapper.writeValueAsBytes(node); } catch (Throwable t) { throw new RuntimeExcepti...
### Question: AllowNonRestoredStateQueryParameter extends MessageQueryParameter<Boolean> { @Override public Boolean convertStringToValue(final String value) { return Boolean.valueOf(value); } protected AllowNonRestoredStateQueryParameter(); @Override Boolean convertStringToValue(final String value); @Override String c...
### Question: KafkaConsumerThread extends Thread { public void shutdown() { running = false; unassignedPartitionsQueue.close(); handover.wakeupProducer(); synchronized (consumerReassignmentLock) { if (consumer != null) { consumer.wakeup(); } else { hasBufferedWakeup = true; } } } KafkaConsumerThread( Logger log, ...
### Question: DelegatingConfiguration extends Configuration { @Override public boolean equals(Object obj) { if (obj instanceof DelegatingConfiguration) { DelegatingConfiguration other = (DelegatingConfiguration) obj; return this.prefix.equals(other.prefix) && this.backingConfig.equals(other.backingConfig); } else { ret...
### Question: BucketingSink extends RichSinkFunction<T> implements InputTypeConfigurable, CheckpointedFunction, CheckpointListener, ProcessingTimeCallback { @Override public void open(Configuration parameters) throws Exception { super.open(parameters); state = new State<>(); processingTimeService = ((StreamingRuntimeCo...
### Question: DelegatingConfiguration extends Configuration { @Override public Set<String> keySet() { if (this.prefix == null) { return this.backingConfig.keySet(); } final HashSet<String> set = new HashSet<>(); int prefixLen = this.prefix.length(); for (String key : this.backingConfig.keySet()) { if (key.startsWith(pr...
### Question: RMQSource extends MultipleIdsMessageAcknowledgingSourceBase<OUT, String, Long> implements ResultTypeQueryable<OUT> { @Override public void open(Configuration config) throws Exception { super.open(config); ConnectionFactory factory = setupConnectionFactory(); try { connection = factory.newConnection(); cha...
### Question: CoreOptions { public static String[] getParentFirstLoaderPatterns(Configuration config) { String base = config.getString(ALWAYS_PARENT_FIRST_LOADER_PATTERNS); String append = config.getString(ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL); String[] basePatterns = base.isEmpty() ? new String[0] : base.spl...
### Question: KinesisConfigUtil { public static KinesisProducerConfiguration getValidatedProducerConfiguration(Properties config) { checkNotNull(config, "config can not be null"); validateAwsConfiguration(config); KinesisProducerConfiguration kpc = KinesisProducerConfiguration.fromProperties(config); kpc.setRegion(conf...
### Question: GlobalConfiguration { public static Configuration loadConfiguration() { final String configDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR); if (configDir == null) { return new Configuration(); } return loadConfiguration(configDir, null); } private GlobalConfiguration(); static Configuration loadC...
### Question: KinesisConfigUtil { public static void validateAwsConfiguration(Properties config) { if (config.containsKey(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER)) { String credentialsProviderType = config.getProperty(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER); CredentialProvider providerType; try { providerType ...
### Question: FlinkKinesisProducer extends RichSinkFunction<OUT> implements CheckpointedFunction { public void setCustomPartitioner(KinesisPartitioner<OUT> partitioner) { checkNotNull(partitioner, "partitioner cannot be null"); checkArgument( InstantiationUtil.isSerializable(partitioner), "The provided custom partition...
### Question: KinesisDataFetcher { public static boolean isThisSubtaskShouldSubscribeTo(int shardHash, int totalNumberOfConsumerSubtasks, int indexOfThisConsumerSubtask) { return (Math.abs(shardHash % totalNumberOfConsumerSubtasks)) == indexOfThisConsumerSubtask; } KinesisDataFetcher(List<String> streams, Source...
### Question: FlinkKinesisConsumer extends RichParallelSourceFunction<T> implements ResultTypeQueryable<T>, CheckpointedFunction { @Override public void run(SourceContext<T> sourceContext) throws Exception { KinesisDataFetcher<T> fetcher = createFetcher(streams, sourceContext, getRuntimeContext(), configProps, dese...
### Question: GlobalConfiguration { public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return ...
### Question: StringUtils { public static String arrayToString(Object array) { if (array == null) { throw new NullPointerException(); } if (array instanceof int[]) { return Arrays.toString((int[]) array); } if (array instanceof long[]) { return Arrays.toString((long[]) array); } if (array instanceof Object[]) { return ...
### Question: AbstractID implements Comparable<AbstractID>, java.io.Serializable { @Override public int compareTo(AbstractID o) { int diff1 = Long.compare(this.upperPart, o.upperPart); int diff2 = Long.compare(this.lowerPart, o.lowerPart); return diff1 == 0 ? diff2 : diff1; } AbstractID(byte[] bytes); AbstractID(long ...
### Question: MinWatermarkGauge implements Gauge<Long> { @Override public Long getValue() { return Math.min(watermarkGauge1.getValue(), watermarkGauge2.getValue()); } MinWatermarkGauge(WatermarkGauge watermarkGauge1, WatermarkGauge watermarkGauge2); @Override Long getValue(); }### Answer: @Test public void testSetCurr...
### Question: StreamTask extends AbstractInvokable implements AsyncExceptionHandler { public String getName() { return getEnvironment().getTaskInfo().getTaskNameWithSubtasks(); } protected StreamTask(Environment env); protected StreamTask( Environment environment, @Nullable ProcessingTimeService timeProvider); ...
### Question: LambdaUtil { public static <E extends Throwable> void withContextClassLoader( final ClassLoader cl, final ThrowingRunnable<E> r) throws E { final Thread currentThread = Thread.currentThread(); final ClassLoader oldClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoad...
### Question: SystemProcessingTimeService extends ProcessingTimeService { @Override public ScheduledFuture<?> scheduleAtFixedRate(ProcessingTimeCallback callback, long initialDelay, long period) { long nextTimestamp = getCurrentProcessingTime() + initialDelay; try { return timerService.scheduleAtFixedRate( new Repeated...
### Question: SystemProcessingTimeService extends ProcessingTimeService { @Override public ScheduledFuture<?> registerTimer(long timestamp, ProcessingTimeCallback target) { long delay = Math.max(timestamp - getCurrentProcessingTime(), 0); try { return timerService.schedule( new TriggerTask(status, task, checkpointLock,...
### Question: SystemProcessingTimeService extends ProcessingTimeService { @Override public boolean shutdownServiceUninterruptible(long timeoutMs) { final Deadline deadline = Deadline.fromNow(Duration.ofMillis(timeoutMs)); boolean shutdownComplete = false; boolean receivedInterrupt = false; do { try { shutdownComplete =...
### Question: TwoPhaseCommitSinkFunction extends RichSinkFunction<IN> implements CheckpointedFunction, CheckpointListener { @Override public void initializeState(FunctionInitializationContext context) throws Exception { state = context.getOperatorStateStore().getListState(stateDescriptor); if (context.isRestored()) { L...
### Question: RocksDBKeySerializationUtils { public static boolean isAmbiguousKeyPossible(TypeSerializer keySerializer, TypeSerializer namespaceSerializer) { return (keySerializer.getLength() < 0) && (namespaceSerializer.getLength() < 0); } static int readKeyGroup(int keyGroupPrefixBytes, DataInputView inputView); sta...
### Question: AkkaRpcService implements RpcService { @Override public ScheduledFuture<?> scheduleRunnable(Runnable runnable, long delay, TimeUnit unit) { checkNotNull(runnable, "runnable"); checkNotNull(unit, "unit"); checkArgument(delay >= 0L, "delay must be zero or larger"); return internalScheduledExecutor.schedule(...
### Question: AkkaRpcService implements RpcService { @Override public void execute(Runnable runnable) { actorSystem.dispatcher().execute(runnable); } AkkaRpcService(final ActorSystem actorSystem, final Time timeout); ActorSystem getActorSystem(); @Override String getAddress(); @Override int getPort(); @Override Complet...
### Question: AkkaRpcService implements RpcService { @Override public String getAddress() { return address; } AkkaRpcService(final ActorSystem actorSystem, final Time timeout); ActorSystem getActorSystem(); @Override String getAddress(); @Override int getPort(); @Override CompletableFuture<C> connect( final String a...
### Question: AkkaRpcService implements RpcService { @Override public int getPort() { return port; } AkkaRpcService(final ActorSystem actorSystem, final Time timeout); ActorSystem getActorSystem(); @Override String getAddress(); @Override int getPort(); @Override CompletableFuture<C> connect( final String address, ...
### Question: AkkaRpcService implements RpcService { @Override public CompletableFuture<Void> getTerminationFuture() { return terminationFuture; } AkkaRpcService(final ActorSystem actorSystem, final Time timeout); ActorSystem getActorSystem(); @Override String getAddress(); @Override int getPort(); @Override Completabl...
### Question: SubtaskIndexPathParameter extends MessagePathParameter<Integer> { @Override protected Integer convertFromString(final String value) throws ConversionException { final int subtaskIndex = Integer.parseInt(value); if (subtaskIndex >= 0) { return subtaskIndex; } else { throw new ConversionException("subtaskin...
### Question: SubtaskIndexPathParameter extends MessagePathParameter<Integer> { @Override protected String convertToString(final Integer value) { return value.toString(); } SubtaskIndexPathParameter(); static final String KEY; }### Answer: @Test public void testConvertToString() throws Exception { assertThat(subtaskIn...
### Question: HandlerRequestUtils { public static <X, P extends MessageQueryParameter<X>, R extends RequestBody, M extends MessageParameters> X getQueryParameter( final HandlerRequest<R, M> request, final Class<P> queryParameterClass) throws RestHandlerException { return getQueryParameter(request, queryParameterClass, ...
### Question: FileUtils { public static void deleteDirectory(File directory) throws IOException { checkNotNull(directory, "directory"); guardIfWindows(FileUtils::deleteDirectoryInternal, directory); } private FileUtils(); static String getRandomFilename(final String prefix); static String readFile(File file, String ch...
### Question: ExceptionUtils { public static String stringifyException(final Throwable e) { if (e == null) { return STRINGIFIED_NULL_EXCEPTION; } try { StringWriter stm = new StringWriter(); PrintWriter wrt = new PrintWriter(stm); e.printStackTrace(wrt); wrt.close(); return stm.toString(); } catch (Throwable t) { retur...
### Question: ExceptionUtils { public static boolean isJvmFatalError(Throwable t) { return (t instanceof InternalError) || (t instanceof UnknownError) || (t instanceof ThreadDeath); } private ExceptionUtils(); static String stringifyException(final Throwable e); static boolean isJvmFatalError(Throwable t); static bool...
### Question: AbstractTaskManagerFileHandler extends AbstractHandler<RestfulGateway, EmptyRequestBody, M> { @Override protected void respondToRequest(ChannelHandlerContext ctx, HttpRequest httpRequest, HandlerRequest<EmptyRequestBody, M> handlerRequest, RestfulGateway gateway) throws RestHandlerException { final Resour...
### Question: JobExecutionResultHandler extends AbstractRestHandler<RestfulGateway, EmptyRequestBody, JobExecutionResultResponseBody, JobMessageParameters> { @Override protected CompletableFuture<JobExecutionResultResponseBody> handleRequest( @Nonnull final HandlerRequest<EmptyRequestBody, JobMessageParameters> request...
### Question: ExceptionUtils { public static void rethrowIfFatalError(Throwable t) { if (isJvmFatalError(t)) { throw (Error) t; } } private ExceptionUtils(); static String stringifyException(final Throwable e); static boolean isJvmFatalError(Throwable t); static boolean isJvmFatalOrOutOfMemoryError(Throwable t); stati...
### Question: JobSubmitHandler extends AbstractRestHandler<DispatcherGateway, JobSubmitRequestBody, JobSubmitResponseBody, EmptyMessageParameters> { @Override protected CompletableFuture<JobSubmitResponseBody> handleRequest(@Nonnull HandlerRequest<JobSubmitRequestBody, EmptyMessageParameters> request, @Nonnull Dispatch...
### Question: AbstractMetricsHandler extends AbstractRestHandler<RestfulGateway, EmptyRequestBody, MetricCollectionResponseBody, M> { @Override protected final CompletableFuture<MetricCollectionResponseBody> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, M> request, @Nonnull RestfulGateway gateway) throws Re...
### Question: SubtaskExecutionAttemptAccumulatorsHandler extends AbstractSubtaskAttemptHandler<SubtaskExecutionAttemptAccumulatorsInfo, SubtaskAttemptMessageParameters> implements JsonArchivist { @Override protected SubtaskExecutionAttemptAccumulatorsInfo handleRequest( HandlerRequest<EmptyRequestBody, SubtaskAttemptMe...
### Question: ExceptionUtils { public static <T extends Throwable> Optional<T> findThrowable(Throwable throwable, Class<T> searchType) { if (throwable == null || searchType == null) { return Optional.empty(); } Throwable t = throwable; while (t != null) { if (searchType.isAssignableFrom(t.getClass())) { return Optional...
### Question: JobVertexBackPressureHandler extends AbstractRestHandler<RestfulGateway, EmptyRequestBody, JobVertexBackPressureInfo, JobVertexMessageParameters> { @Override protected CompletableFuture<JobVertexBackPressureInfo> handleRequest( @Nonnull HandlerRequest<EmptyRequestBody, JobVertexMessageParameters> request,...
### Question: RestServerEndpoint implements AutoCloseableAsync { @VisibleForTesting static void createUploadDir(final Path uploadDir, final Logger log) throws IOException { if (!Files.exists(uploadDir)) { log.warn("Upload directory {} does not exist, or has been deleted externally. " + "Previously uploaded files are no...
### Question: RestClient { public <M extends MessageHeaders<R, P, U>, U extends MessageParameters, R extends RequestBody, P extends ResponseBody> CompletableFuture<P> sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request) throws IOException { Preconditions.checkNotNull(targe...
### Question: MetricRegistryImpl implements MetricRegistry { public boolean isShutdown() { synchronized (lock) { return isShutdown; } } MetricRegistryImpl(MetricRegistryConfiguration config); void startQueryService(ActorSystem actorSystem, ResourceID resourceID); @Override @Nullable String getMetricQueryServicePath(); ...
### Question: TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BY...
### Question: AbstractMetricGroup implements MetricGroup { public Map<String, String> getAllVariables() { if (variables == null) { synchronized (this) { if (variables == null) { variables = new HashMap<>(); putVariables(variables); if (parent != null) { variables.putAll(parent.getAllVariables()); } } } } return variabl...
### Question: AbstractMetricGroup implements MetricGroup { public String getMetricIdentifier(String metricName) { return getMetricIdentifier(metricName, null); } AbstractMetricGroup(MetricRegistry registry, String[] scope, A parent); Map<String, String> getAllVariables(); String getLogicalScope(CharacterFilter filter);...
### Question: TaskMetricGroup extends ComponentMetricGroup<TaskManagerJobMetricGroup> { @Override protected QueryScopeInfo.TaskQueryScopeInfo createQueryServiceMetricInfo(CharacterFilter filter) { return new QueryScopeInfo.TaskQueryScopeInfo( this.parent.jobId.toString(), String.valueOf(this.vertexId), this.subtaskInde...
### Question: TaskMetricGroup extends ComponentMetricGroup<TaskManagerJobMetricGroup> { @Override public void close() { super.close(); parent.removeTaskMetricGroup(executionId); } TaskMetricGroup( MetricRegistry registry, TaskManagerJobMetricGroup parent, @Nullable JobVertexID vertexId, AbstractID execution...
### Question: TaskMetricGroup extends ComponentMetricGroup<TaskManagerJobMetricGroup> { public OperatorMetricGroup addOperator(String name) { return addOperator(OperatorID.fromJobVertexID(vertexId), name); } TaskMetricGroup( MetricRegistry registry, TaskManagerJobMetricGroup parent, @Nullable JobVertexID verte...
### Question: TaskEventDispatcher { public void registerPartition(ResultPartitionID partitionId) { checkNotNull(partitionId); synchronized (registeredHandlers) { LOG.debug("registering {}", partitionId); if (registeredHandlers.put(partitionId, new TaskEventHandler()) != null) { throw new IllegalStateException( "Partiti...
### Question: TaskEventDispatcher { public void subscribeToEvent( ResultPartitionID partitionId, EventListener<TaskEvent> eventListener, Class<? extends TaskEvent> eventType) { checkNotNull(partitionId); checkNotNull(eventListener); checkNotNull(eventType); TaskEventHandler taskEventHandler; synchronized (registeredHan...
### Question: TaskEventDispatcher { public void unregisterPartition(ResultPartitionID partitionId) { checkNotNull(partitionId); synchronized (registeredHandlers) { LOG.debug("unregistering {}", partitionId); registeredHandlers.remove(partitionId); } } void registerPartition(ResultPartitionID partitionId); void unregis...
### Question: TaskEventDispatcher { public void clearAll() { synchronized (registeredHandlers) { registeredHandlers.clear(); } } void registerPartition(ResultPartitionID partitionId); void unregisterPartition(ResultPartitionID partitionId); void subscribeToEvent( ResultPartitionID partitionId, EventListener<Task...
### Question: CreditBasedPartitionRequestClientHandler extends ChannelInboundHandlerAdapter implements NetworkClientHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { decodeMsg(msg); } catch (Throwable t) { notifyAllChannelsOfErrorAndClose(t); } } @Override void...
### Question: PipelinedSubpartition extends ResultSubpartition { @Override public PipelinedSubpartitionView createReadView(BufferAvailabilityListener availabilityListener) throws IOException { synchronized (buffers) { checkState(!isReleased); checkState(readView == null, "Subpartition %s of is being (or already has bee...
### Question: PipelinedSubpartition extends ResultSubpartition { @Override public boolean isReleased() { return isReleased; } PipelinedSubpartition(int index, ResultPartition parent); @Override boolean add(BufferConsumer bufferConsumer); @Override void flush(); @Override void finish(); @Override void release(); @Overri...
### Question: RemoteInputChannel extends InputChannel implements BufferRecycler, BufferListener { void retriggerSubpartitionRequest(int subpartitionIndex) throws IOException, InterruptedException { checkState(partitionRequestClient != null, "Missing initial subpartition request."); if (increaseBackoff()) { partitionReq...