org.apache.flink.runtime.metrics.MetricRegistry Java Examples

The following examples show how to use org.apache.flink.runtime.metrics.MetricRegistry. 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: MetricGroupTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}.
 */
@Test
public void testNameCollisionAfterKeyValueGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key, value);
	MetricGroup group = root.addGroup(key).addGroup(value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertEquals(value, variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertFalse("Value is present in logical scope.", logicalScope.contains(value));
}
 
Example #2
Source File: MetricUtils.java    From flink with Apache License 2.0 6 votes vote down vote up
public static Tuple2<TaskManagerMetricGroup, MetricGroup> instantiateTaskManagerMetricGroup(
		MetricRegistry metricRegistry,
		String hostName,
		ResourceID resourceID,
		Optional<Time> systemResourceProbeInterval) {
	final TaskManagerMetricGroup taskManagerMetricGroup = new TaskManagerMetricGroup(
		metricRegistry,
		hostName,
		resourceID.toString());

	MetricGroup statusGroup = createAndInitializeStatusMetricGroup(taskManagerMetricGroup);

	if (systemResourceProbeInterval.isPresent()) {
		instantiateSystemMetrics(taskManagerMetricGroup, systemResourceProbeInterval.get());
	}
	return Tuple2.of(taskManagerMetricGroup, statusGroup);
}
 
Example #3
Source File: ActiveResourceManagerFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public ResourceManager<T> createResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		MetricRegistry metricRegistry,
		String hostname) throws Exception {
	return super.createResourceManager(
		createActiveResourceManagerConfiguration(configuration),
		resourceId,
		rpcService,
		highAvailabilityServices,
		heartbeatServices,
		fatalErrorHandler,
		clusterInformation,
		webInterfaceUrl,
		metricRegistry,
		hostname);
}
 
Example #4
Source File: StandaloneResourceManager.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public StandaloneResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		jobManagerMetricGroup);
}
 
Example #5
Source File: MetricGroupTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already
 * exists goes through the generic code path.
 */
@Test
public void testNameCollisionForKeyAfterGenericGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key);
	MetricGroup group = root.addGroup(key, value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertNull(variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertTrue("Value is missing from logical scope.", logicalScope.contains(value));
}
 
Example #6
Source File: MetricUtils.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public static TaskManagerMetricGroup instantiateTaskManagerMetricGroup(
		MetricRegistry metricRegistry,
		TaskManagerLocation taskManagerLocation,
		NetworkEnvironment network,
		Optional<Time> systemResourceProbeInterval) {
	final TaskManagerMetricGroup taskManagerMetricGroup = new TaskManagerMetricGroup(
		metricRegistry,
		taskManagerLocation.getHostname(),
		taskManagerLocation.getResourceID().toString());

	MetricGroup statusGroup = taskManagerMetricGroup.addGroup(METRIC_GROUP_STATUS_NAME);

	// Initialize the TM metrics
	instantiateStatusMetrics(statusGroup);

	MetricGroup networkGroup = statusGroup
		.addGroup("Network");
	instantiateNetworkMetrics(networkGroup, network);

	if (systemResourceProbeInterval.isPresent()) {
		instantiateSystemMetrics(taskManagerMetricGroup, systemResourceProbeInterval.get());
	}
	return taskManagerMetricGroup;
}
 
Example #7
Source File: MetricUtils.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public static JobManagerMetricGroup instantiateJobManagerMetricGroup(
		final MetricRegistry metricRegistry,
		final String hostname,
		final Optional<Time> systemResourceProbeInterval) {
	final JobManagerMetricGroup jobManagerMetricGroup = new JobManagerMetricGroup(
		metricRegistry,
		hostname);

	MetricGroup statusGroup = jobManagerMetricGroup.addGroup(METRIC_GROUP_STATUS_NAME);

	// initialize the JM metrics
	instantiateStatusMetrics(statusGroup);

	if (systemResourceProbeInterval.isPresent()) {
		instantiateSystemMetrics(jobManagerMetricGroup, systemResourceProbeInterval.get());
	}
	return jobManagerMetricGroup;
}
 
Example #8
Source File: MetricUtils.java    From flink with Apache License 2.0 6 votes vote down vote up
public static Tuple2<TaskManagerMetricGroup, MetricGroup> instantiateTaskManagerMetricGroup(
		MetricRegistry metricRegistry,
		String hostName,
		ResourceID resourceID,
		Optional<Time> systemResourceProbeInterval) {
	final TaskManagerMetricGroup taskManagerMetricGroup = new TaskManagerMetricGroup(
		metricRegistry,
		hostName,
		resourceID.toString());

	MetricGroup statusGroup = taskManagerMetricGroup.addGroup(METRIC_GROUP_STATUS_NAME);

	// Initialize the TM metrics
	instantiateStatusMetrics(statusGroup);

	if (systemResourceProbeInterval.isPresent()) {
		instantiateSystemMetrics(taskManagerMetricGroup, systemResourceProbeInterval.get());
	}
	return Tuple2.of(taskManagerMetricGroup, statusGroup);
}
 
Example #9
Source File: ActiveResourceManagerFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public ResourceManager<T> createResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		JobManagerMetricGroup jobManagerMetricGroup) throws Exception {
	return createActiveResourceManager(
		createActiveResourceManagerConfiguration(configuration),
		resourceId,
		rpcService,
		highAvailabilityServices,
		heartbeatServices,
		metricRegistry,
		fatalErrorHandler,
		clusterInformation,
		webInterfaceUrl,
		jobManagerMetricGroup);
}
 
Example #10
Source File: MetricGroupTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already
 * exists goes through the generic code path.
 */
@Test
public void testNameCollisionForKeyAfterGenericGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key);
	MetricGroup group = root.addGroup(key, value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertNull(variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertTrue("Value is missing from logical scope.", logicalScope.contains(value));
}
 
Example #11
Source File: MetricGroupTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}.
 */
@Test
public void testNameCollisionAfterKeyValueGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key, value);
	MetricGroup group = root.addGroup(key).addGroup(value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertEquals(value, variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertFalse("Value is present in logical scope.", logicalScope.contains(value));
}
 
Example #12
Source File: MiniCluster.java    From flink with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
protected Collection<? extends DispatcherResourceManagerComponent<?>> createDispatcherResourceManagerComponents(
		Configuration configuration,
		RpcServiceFactory rpcServiceFactory,
		HighAvailabilityServices haServices,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		MetricQueryServiceRetriever metricQueryServiceRetriever,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	SessionDispatcherResourceManagerComponentFactory dispatcherResourceManagerComponentFactory = createDispatcherResourceManagerComponentFactory();
	return Collections.singleton(
		dispatcherResourceManagerComponentFactory.create(
			configuration,
			rpcServiceFactory.createRpcService(),
			haServices,
			blobServer,
			heartbeatServices,
			metricRegistry,
			new MemoryArchivedExecutionGraphStore(),
			metricQueryServiceRetriever,
			fatalErrorHandler));
}
 
Example #13
Source File: TestingResourceManager.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public TestingResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		new ClusterInformation("localhost", 1234),
		fatalErrorHandler,
		jobManagerMetricGroup);
}
 
Example #14
Source File: MetricGroupTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies the basic behavior when defining user-defined variables.
 */
@Test
public void testUserDefinedVariable() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";
	MetricGroup group = root.addGroup(key, value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertEquals(value, variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertFalse("Value is present in logical scope.", logicalScope.contains(value));
}
 
Example #15
Source File: MetricGroupTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already
 * exists goes through the generic code path.
 */
@Test
public void testNameCollisionForKeyAfterGenericGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key);
	MetricGroup group = root.addGroup(key, value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertNull(variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertTrue("Value is missing from logical scope.", logicalScope.contains(value));
}
 
Example #16
Source File: MetricGroupTest.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}.
 */
@Test
public void testNameCollisionAfterKeyValueGroup() {
	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root");

	String key = "key";
	String value = "value";

	root.addGroup(key, value);
	MetricGroup group = root.addGroup(key).addGroup(value);

	String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key"));
	assertEquals(value, variableValue);

	String identifier = group.getMetricIdentifier("metric");
	assertTrue("Key is missing from metric identifier.", identifier.contains("key"));
	assertTrue("Value is missing from metric identifier.", identifier.contains("value"));

	String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter());
	assertTrue("Key is missing from logical scope.", logicalScope.contains(key));
	assertFalse("Value is present in logical scope.", logicalScope.contains(value));
}
 
Example #17
Source File: ActiveResourceManagerFactoryTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
protected ResourceManager<ResourceID> createActiveResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		JobManagerMetricGroup jobManagerMetricGroup) {
	assertThat(configuration.contains(TaskManagerOptions.MANAGED_MEMORY_SIZE), is(true));

	return null;
}
 
Example #18
Source File: TestingResourceManager.java    From flink with Apache License 2.0 6 votes vote down vote up
public TestingResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		new ClusterInformation("localhost", 1234),
		fatalErrorHandler,
		jobManagerMetricGroup);
}
 
Example #19
Source File: MiniCluster.java    From flink with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
protected Collection<? extends DispatcherResourceManagerComponent> createDispatcherResourceManagerComponents(
		Configuration configuration,
		RpcServiceFactory rpcServiceFactory,
		HighAvailabilityServices haServices,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		MetricQueryServiceRetriever metricQueryServiceRetriever,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	DispatcherResourceManagerComponentFactory dispatcherResourceManagerComponentFactory = createDispatcherResourceManagerComponentFactory();
	return Collections.singleton(
		dispatcherResourceManagerComponentFactory.create(
			configuration,
			ioExecutor,
			rpcServiceFactory.createRpcService(),
			haServices,
			blobServer,
			heartbeatServices,
			metricRegistry,
			new MemoryArchivedExecutionGraphStore(),
			metricQueryServiceRetriever,
			fatalErrorHandler));
}
 
Example #20
Source File: FlinkMetricContainerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRegisterMetricGroup() {
	MetricKey key = MetricKey.create("step", MetricName.named(DEFAULT_NAMESPACE, "name"));

	MetricRegistry registry = NoOpMetricRegistry.INSTANCE;
	GenericMetricGroup root = new GenericMetricGroup(
		registry,
		new MetricGroupTest.DummyAbstractMetricGroup(registry),
		"root");
	MetricGroup metricGroup = FlinkMetricContainer.registerMetricGroup(key, root);

	assertThat(metricGroup.getScopeComponents(), is(Arrays.asList("root", "key", "value").toArray()));
}
 
Example #21
Source File: DispatcherResourceManagerComponentFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
DispatcherResourceManagerComponent<T> create(
Configuration configuration,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
BlobServer blobServer,
HeartbeatServices heartbeatServices,
MetricRegistry metricRegistry,
ArchivedExecutionGraphStore archivedExecutionGraphStore,
MetricQueryServiceRetriever metricQueryServiceRetriever,
FatalErrorHandler fatalErrorHandler) throws Exception;
 
Example #22
Source File: TestingMiniCluster.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected Collection<? extends DispatcherResourceManagerComponent<?>> createDispatcherResourceManagerComponents(
		Configuration configuration,
		RpcServiceFactory rpcServiceFactory,
		HighAvailabilityServices haServices,
		BlobServer blobServer,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		MetricQueryServiceRetriever metricQueryServiceRetriever,
		FatalErrorHandler fatalErrorHandler) throws Exception {
	SessionDispatcherResourceManagerComponentFactory dispatcherResourceManagerComponentFactory = createTestingDispatcherResourceManagerComponentFactory();

	final List<DispatcherResourceManagerComponent<?>> result = new ArrayList<>(numberDispatcherResourceManagerComponents);

	for (int i = 0; i < numberDispatcherResourceManagerComponents; i++) {
		result.add(
			dispatcherResourceManagerComponentFactory.create(
				configuration,
				rpcServiceFactory.createRpcService(),
				haServices,
				blobServer,
				heartbeatServices,
				metricRegistry,
				new MemoryArchivedExecutionGraphStore(),
				metricQueryServiceRetriever,
				fatalErrorHandler));
	}

	return result;
}
 
Example #23
Source File: ResourceManagerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
ResourceManager<T> createResourceManager(
Configuration configuration,
ResourceID resourceId,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
MetricRegistry metricRegistry,
FatalErrorHandler fatalErrorHandler,
ClusterInformation clusterInformation,
@Nullable String webInterfaceUrl,
JobManagerMetricGroup jobManagerMetricGroup) throws Exception;
 
Example #24
Source File: StandaloneResourceManagerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private TestingStandaloneResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		JobManagerMetricGroup jobManagerMetricGroup,
		Time startupPeriodTime,
		MockResourceManagerRuntimeServices rmServices) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		jobManagerMetricGroup,
		startupPeriodTime);
	this.rmServices = rmServices;
}
 
Example #25
Source File: MesosResourceManagerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
public TestingMesosResourceManager(
	RpcService rpcService,
	String resourceManagerEndpointId,
	ResourceID resourceId,
	HighAvailabilityServices highAvailabilityServices,
	HeartbeatServices heartbeatServices,
	SlotManager slotManager,
	MetricRegistry metricRegistry,
	JobLeaderIdService jobLeaderIdService,
	FatalErrorHandler fatalErrorHandler,

	// Mesos specifics
	Configuration flinkConfig,
	MesosServices mesosServices,
	MesosConfiguration mesosConfig,
	MesosTaskManagerParameters taskManagerParameters,
	ContainerSpecification taskManagerContainerSpec,
	JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		new ClusterInformation("localhost", 1234),
		fatalErrorHandler,
		flinkConfig,
		mesosServices,
		mesosConfig,
		taskManagerParameters,
		taskManagerContainerSpec,
		null,
		jobManagerMetricGroup);
}
 
Example #26
Source File: TaskManagerJobMetricGroup.java    From flink with Apache License 2.0 5 votes vote down vote up
public TaskManagerJobMetricGroup(
		MetricRegistry registry,
		TaskManagerMetricGroup parent,
		JobID jobId,
		@Nullable String jobName) {
	super(registry, parent, jobId, jobName, registry.getScopeFormats().getTaskManagerJobFormat().formatScope(checkNotNull(parent), jobId, jobName));
}
 
Example #27
Source File: AbstractMetricGroup.java    From flink with Apache License 2.0 5 votes vote down vote up
public AbstractMetricGroup(MetricRegistry registry, String[] scope, A parent) {
	this.registry = checkNotNull(registry);
	this.scopeComponents = checkNotNull(scope);
	this.parent = parent;
	this.scopeStrings = new String[registry.getNumberReporters()];
	this.logicalScopeStrings = new String[registry.getNumberReporters()];
}
 
Example #28
Source File: YarnResourceManagerTest.java    From flink with Apache License 2.0 5 votes vote down vote up
TestingYarnResourceManager(
		RpcService rpcService,
		String resourceManagerEndpointId,
		ResourceID resourceId,
		Configuration flinkConfig,
		Map<String, String> env,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		SlotManager slotManager,
		MetricRegistry metricRegistry,
		JobLeaderIdService jobLeaderIdService,
		ClusterInformation clusterInformation,
		FatalErrorHandler fatalErrorHandler,
		@Nullable String webInterfaceUrl,
		AMRMClientAsync<AMRMClient.ContainerRequest> mockResourceManagerClient,
		NMClient mockNMClient,
		JobManagerMetricGroup jobManagerMetricGroup) {
	super(
		rpcService,
		resourceManagerEndpointId,
		resourceId,
		flinkConfig,
		env,
		highAvailabilityServices,
		heartbeatServices,
		slotManager,
		metricRegistry,
		jobLeaderIdService,
		clusterInformation,
		fatalErrorHandler,
		webInterfaceUrl,
		jobManagerMetricGroup);
	this.mockNMClient = mockNMClient;
	this.mockResourceManagerClient = mockResourceManagerClient;
}
 
Example #29
Source File: YarnResourceManagerFactory.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public ResourceManager<YarnWorkerNode> createActiveResourceManager(
		Configuration configuration,
		ResourceID resourceId,
		RpcService rpcService,
		HighAvailabilityServices highAvailabilityServices,
		HeartbeatServices heartbeatServices,
		MetricRegistry metricRegistry,
		FatalErrorHandler fatalErrorHandler,
		ClusterInformation clusterInformation,
		@Nullable String webInterfaceUrl,
		JobManagerMetricGroup jobManagerMetricGroup) throws Exception {
	final ResourceManagerRuntimeServicesConfiguration rmServicesConfiguration = ResourceManagerRuntimeServicesConfiguration.fromConfiguration(configuration);
	final ResourceManagerRuntimeServices rmRuntimeServices = ResourceManagerRuntimeServices.fromConfiguration(
		rmServicesConfiguration,
		highAvailabilityServices,
		rpcService.getScheduledExecutor());

	return new YarnResourceManager(
		rpcService,
		getEndpointId(),
		resourceId,
		configuration,
		System.getenv(),
		highAvailabilityServices,
		heartbeatServices,
		rmRuntimeServices.getSlotManager(),
		metricRegistry,
		rmRuntimeServices.getJobLeaderIdService(),
		clusterInformation,
		fatalErrorHandler,
		webInterfaceUrl,
		jobManagerMetricGroup);
}
 
Example #30
Source File: TaskManagerJobMetricGroup.java    From flink with Apache License 2.0 5 votes vote down vote up
public TaskManagerJobMetricGroup(
		MetricRegistry registry,
		TaskManagerMetricGroup parent,
		JobID jobId,
		@Nullable String jobName) {
	super(registry, parent, jobId, jobName, registry.getScopeFormats().getTaskManagerJobFormat().formatScope(checkNotNull(parent), jobId, jobName));
}