org.apache.flink.util.AbstractCloseableRegistry Java Examples

The following examples show how to use org.apache.flink.util.AbstractCloseableRegistry. 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: CloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected ProducerThread<Closeable, Object> createProducerThread(
	AbstractCloseableRegistry<Closeable, Object> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new ProducerThread<Closeable, Object>(registry, unclosedCounter, maxStreams) {
		@Override
		protected void createAndRegisterStream() throws IOException {
			TestStream testStream = new TestStream(unclosedCounter);
			registry.registerCloseable(testStream);
		}
	};
}
 
Example #2
Source File: SafetyNetCloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistryTest.ProducerThread<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createProducerThread(
	AbstractCloseableRegistry<
		WrappingProxyCloseable<? extends Closeable>,
		SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new AbstractCloseableRegistryTest.ProducerThread
		<WrappingProxyCloseable<? extends Closeable>,
			SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef>(registry, unclosedCounter, maxStreams) {

		int count = 0;

		@Override
		protected void createAndRegisterStream() throws IOException {
			String debug = Thread.currentThread().getName() + " " + count;
			TestStream testStream = new TestStream(refCount);

			// this method automatically registers the stream with the given registry.
			@SuppressWarnings("unused")
			ClosingFSDataInputStream pis = ClosingFSDataInputStream.wrapSafe(
				testStream, (SafetyNetCloseableRegistry) registry,
				debug); //reference dies here
			++count;
		}
	};
}
 
Example #3
Source File: SafetyNetCloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistry<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createRegistry() {

	return new SafetyNetCloseableRegistry();
}
 
Example #4
Source File: CloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected ProducerThread<Closeable, Object> createProducerThread(
	AbstractCloseableRegistry<Closeable, Object> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new ProducerThread<Closeable, Object>(registry, unclosedCounter, maxStreams) {
		@Override
		protected void createAndRegisterStream() throws IOException {
			TestStream testStream = new TestStream(unclosedCounter);
			registry.registerCloseable(testStream);
		}
	};
}
 
Example #5
Source File: SafetyNetCloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistryTest.ProducerThread<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createProducerThread(
	AbstractCloseableRegistry<
		WrappingProxyCloseable<? extends Closeable>,
		SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new AbstractCloseableRegistryTest.ProducerThread
		<WrappingProxyCloseable<? extends Closeable>,
			SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef>(registry, unclosedCounter, maxStreams) {

		int count = 0;

		@Override
		protected void createAndRegisterStream() throws IOException {
			String debug = Thread.currentThread().getName() + " " + count;
			TestStream testStream = new TestStream(refCount);

			// this method automatically registers the stream with the given registry.
			@SuppressWarnings("unused")
			ClosingFSDataInputStream pis = ClosingFSDataInputStream.wrapSafe(
				testStream, (SafetyNetCloseableRegistry) registry,
				debug); //reference dies here
			++count;
		}
	};
}
 
Example #6
Source File: SafetyNetCloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistry<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createRegistry() {

	return new SafetyNetCloseableRegistry();
}
 
Example #7
Source File: CloseableRegistryTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected ProducerThread<Closeable, Object> createProducerThread(
	AbstractCloseableRegistry<Closeable, Object> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new ProducerThread<Closeable, Object>(registry, unclosedCounter, maxStreams) {
		@Override
		protected void createAndRegisterStream() throws IOException {
			TestStream testStream = new TestStream(unclosedCounter);
			registry.registerCloseable(testStream);
		}
	};
}
 
Example #8
Source File: SafetyNetCloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistryTest.ProducerThread<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createProducerThread(
	AbstractCloseableRegistry<
		WrappingProxyCloseable<? extends Closeable>,
		SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> registry,
	AtomicInteger unclosedCounter,
	int maxStreams) {

	return new AbstractCloseableRegistryTest.ProducerThread
		<WrappingProxyCloseable<? extends Closeable>,
			SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef>(registry, unclosedCounter, maxStreams) {

		int count = 0;

		@Override
		protected void createAndRegisterStream() throws IOException {
			String debug = Thread.currentThread().getName() + " " + count;
			TestStream testStream = new TestStream(refCount);

			// this method automatically registers the stream with the given registry.
			@SuppressWarnings("unused")
			ClosingFSDataInputStream pis = ClosingFSDataInputStream.wrapSafe(
				testStream, (SafetyNetCloseableRegistry) registry,
				debug); //reference dies here
			++count;
		}
	};
}
 
Example #9
Source File: SafetyNetCloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected AbstractCloseableRegistry<
	WrappingProxyCloseable<? extends Closeable>,
	SafetyNetCloseableRegistry.PhantomDelegatingCloseableRef> createRegistry() {

	return new SafetyNetCloseableRegistry();
}
 
Example #10
Source File: CloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractCloseableRegistry<Closeable, Object> createRegistry() {

	return new CloseableRegistry();
}
 
Example #11
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
protected abstract ProducerThread<C, T> createProducerThread(
AbstractCloseableRegistry<C, T> registry,
AtomicInteger unclosedCounter,
int maxStreams);
 
Example #12
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
public ProducerThread(AbstractCloseableRegistry<C, T> registry, AtomicInteger refCount, int maxStreams) {
	this.registry = registry;
	this.refCount = refCount;
	this.maxStreams = maxStreams;
	this.numStreams = 0;
}
 
Example #13
Source File: AbstractCloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public ProducerThread(AbstractCloseableRegistry<C, T> registry, AtomicInteger refCount, int maxStreams) {
	this.registry = registry;
	this.refCount = refCount;
	this.maxStreams = maxStreams;
	this.numStreams = 0;
}
 
Example #14
Source File: CloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractCloseableRegistry<Closeable, Object> createRegistry() {

	return new CloseableRegistry();
}
 
Example #15
Source File: AbstractCloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
protected abstract ProducerThread<C, T> createProducerThread(
AbstractCloseableRegistry<C, T> registry,
AtomicInteger unclosedCounter,
int maxStreams);
 
Example #16
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
protected abstract ProducerThread<C, T> createProducerThread(
AbstractCloseableRegistry<C, T> registry,
AtomicInteger unclosedCounter,
int maxStreams);
 
Example #17
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 4 votes vote down vote up
public ProducerThread(AbstractCloseableRegistry<C, T> registry, AtomicInteger refCount, int maxStreams) {
	this.registry = registry;
	this.refCount = refCount;
	this.maxStreams = maxStreams;
	this.numStreams = 0;
}
 
Example #18
Source File: CloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractCloseableRegistry<Closeable, Object> createRegistry() {

	return new CloseableRegistry();
}
 
Example #19
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 votes vote down vote up
protected abstract AbstractCloseableRegistry<C, T> createRegistry(); 
Example #20
Source File: AbstractCloseableRegistryTest.java    From flink with Apache License 2.0 votes vote down vote up
protected abstract AbstractCloseableRegistry<C, T> createRegistry(); 
Example #21
Source File: AbstractCloseableRegistryTest.java    From Flink-CEPplus with Apache License 2.0 votes vote down vote up
protected abstract AbstractCloseableRegistry<C, T> createRegistry();