test_class.file: flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/nfa/SharedBufferTest.java
test_class.identifier: SharedBufferTest
test_class.superclass: extends TestLogger
test_case.body: @Test
  	public void testSharedBuffer() {
  		SharedBuffer<String, Event> sharedBuffer = new SharedBuffer<>(Event.createTypeSerializer());
  		int numberEvents = 8;
  		Event[] events = new Event[numberEvents];
  		final long timestamp = 1L;
  
  		for (int i = 0; i < numberEvents; i++) {
  			events[i] = new Event(i + 1, "e" + (i + 1), i);
  		}
  
  		LinkedHashMultimap<String, Event> expectedPattern1 = LinkedHashMultimap.create();
  		expectedPattern1.put("a1", events[2]);
  		expectedPattern1.put("a[]", events[3]);
  		expectedPattern1.put("b", events[5]);
  
  		LinkedHashMultimap<String, Event> expectedPattern2 = LinkedHashMultimap.create();
  		expectedPattern2.put("a1", events[0]);
  		expectedPattern2.put("a[]", events[1]);
  		expectedPattern2.put("a[]", events[2]);
  		expectedPattern2.put("a[]", events[3]);
  		expectedPattern2.put("a[]", events[4]);
  		expectedPattern2.put("b", events[5]);
  
  		LinkedHashMultimap<String, Event> expectedPattern3 = LinkedHashMultimap.create();
  		expectedPattern3.put("a1", events[0]);
  		expectedPattern3.put("a[]", events[1]);
  		expectedPattern3.put("a[]", events[2]);
  		expectedPattern3.put("a[]", events[3]);
  		expectedPattern3.put("a[]", events[4]);
  		expectedPattern3.put("a[]", events[5]);
  		expectedPattern3.put("a[]", events[6]);
  		expectedPattern3.put("b", events[7]);
  
  		sharedBuffer.put("a1", events[0], timestamp, null, null, 0, DeweyNumber.fromString("1"));
  		sharedBuffer.put("a[]", events[1], timestamp, "a1", events[0], timestamp, DeweyNumber.fromString("1.0"));
  		sharedBuffer.put("a1", events[2], timestamp, null, null, 0, DeweyNumber.fromString("2"));
  		sharedBuffer.put("a[]", events[2], timestamp, "a[]", events[1], timestamp, DeweyNumber.fromString("1.0"));
  		sharedBuffer.put("a[]", events[3], timestamp, "a[]", events[2], timestamp, DeweyNumber.fromString("1.0"));
  		sharedBuffer.put("a[]", events[3], timestamp, "a1", events[2], timestamp, DeweyNumber.fromString("2.0"));
  		sharedBuffer.put("a[]", events[4], timestamp, "a[]", events[3], timestamp, DeweyNumber.fromString("1.0"));
  		sharedBuffer.put("a[]", events[5], timestamp, "a[]", events[4], timestamp, DeweyNumber.fromString("1.1"));
  		sharedBuffer.put("b", events[5], timestamp, "a[]", events[3], timestamp, DeweyNumber.fromString("2.0.0"));
  		sharedBuffer.put("b", events[5], timestamp, "a[]", events[4], timestamp, DeweyNumber.fromString("1.0.0"));
  		sharedBuffer.put("a[]", events[6], timestamp, "a[]", events[5], timestamp, DeweyNumber.fromString("1.1"));
  		sharedBuffer.put("b", events[7], timestamp, "a[]", events[6], timestamp, DeweyNumber.fromString("1.1.0"));
  
  		Collection<LinkedHashMultimap<String, Event>> patterns3 = sharedBuffer.extractPatterns("b", events[7], timestamp, DeweyNumber.fromString("1.1.0"));
  		sharedBuffer.remove("b", events[7], timestamp);
  		Collection<LinkedHashMultimap<String, Event>> patterns4 = sharedBuffer.extractPatterns("b", events[7], timestamp, DeweyNumber.fromString("1.1.0"));
  		Collection<LinkedHashMultimap<String, Event>> patterns1 = sharedBuffer.extractPatterns("b", events[5], timestamp, DeweyNumber.fromString("2.0.0"));
  		Collection<LinkedHashMultimap<String, Event>> patterns2 = sharedBuffer.extractPatterns("b", events[5], timestamp, DeweyNumber.fromString("1.0.0"));
  		sharedBuffer.remove("b", events[5], timestamp);
  
  		assertTrue(sharedBuffer.isEmpty());
  		assertTrue(patterns4.isEmpty());
  		assertEquals(Collections.singletonList(expectedPattern1), patterns1);
  		assertEquals(Collections.singletonList(expectedPattern2), patterns2);
  		assertEquals(Collections.singletonList(expectedPattern3), patterns3);
  	}
test_case.class_method_signature: SharedBufferTest.testSharedBuffer()
test_case.full_signature: @Test public void testSharedBuffer()
test_case.identifier: testSharedBuffer
test_case.invocations: createTypeSerializer create put put put create put put put put put put create put put put put put put put put put fromString put fromString put fromString put fromString put fromString put fromString put fromString put fromString put fromString put fromString put fromString put fromString extractPatterns fromString remove extractPatterns fromString extractPatterns fromString extractPatterns fromString remove assertTrue isEmpty assertTrue isEmpty assertEquals singletonList assertEquals singletonList assertEquals singletonList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSharedBuffer()
focal_class.declarator: serialVersionUID = 9213251042562206495L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 9213251042562206495L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: valueSerializer
focal_class.modifier: private final
focal_class.original_string: private final TypeSerializer<V> valueSerializer;
focal_class.type: TypeSerializer<V>
focal_class.var_name: valueSerializer
focal_class.declarator: pages
focal_class.modifier: private transient
focal_class.original_string: private transient Map<K, SharedBufferPage<K, V>> pages;
focal_class.type: Map<K, SharedBufferPage<K, V>>
focal_class.var_name: pages
focal_class.file: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java
focal_class.identifier: SharedBuffer
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: SharedBuffer.SharedBuffer(final TypeSerializer<V> valueSerializer)
focal_class.full_signature: public  SharedBuffer(final TypeSerializer<V> valueSerializer)
focal_class.identifier: SharedBuffer
focal_class.modifiers: public
focal_class.parameters: (final TypeSerializer<V> valueSerializer)
focal_class.signature:  SharedBuffer(final TypeSerializer<V> valueSerializer)
focal_class.class_method_signature: SharedBuffer.put(
  			final K key,
  			final V value,
  			final long timestamp,
  			final K previousKey,
  			final V previousValue,
  			final long previousTimestamp,
  			final DeweyNumber version)
focal_class.full_signature: public void put(
  			final K key,
  			final V value,
  			final long timestamp,
  			final K previousKey,
  			final V previousValue,
  			final long previousTimestamp,
  			final DeweyNumber version)
focal_class.identifier: put
focal_class.modifiers: public
focal_class.parameters: (
  			final K key,
  			final V value,
  			final long timestamp,
  			final K previousKey,
  			final V previousValue,
  			final long previousTimestamp,
  			final DeweyNumber version)
focal_class.return: void
focal_class.signature: void put(
  			final K key,
  			final V value,
  			final long timestamp,
  			final K previousKey,
  			final V previousValue,
  			final long previousTimestamp,
  			final DeweyNumber version)
focal_class.class_method_signature: SharedBuffer.contains(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.full_signature: public boolean contains(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.identifier: contains
focal_class.modifiers: public
focal_class.parameters: (
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.return: boolean
focal_class.signature: boolean contains(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.class_method_signature: SharedBuffer.isEmpty()
focal_class.full_signature: public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: SharedBuffer.prune(long pruningTimestamp)
focal_class.full_signature: public void prune(long pruningTimestamp)
focal_class.identifier: prune
focal_class.modifiers: public
focal_class.parameters: (long pruningTimestamp)
focal_class.return: void
focal_class.signature: void prune(long pruningTimestamp)
focal_class.class_method_signature: SharedBuffer.extractPatterns(
  		final K key,
  		final V value,
  		final long timestamp,
  		final DeweyNumber version)
focal_class.full_signature: public Collection<LinkedHashMultimap<K, V>> extractPatterns(
  		final K key,
  		final V value,
  		final long timestamp,
  		final DeweyNumber version)
focal_class.identifier: extractPatterns
focal_class.modifiers: public
focal_class.parameters: (
  		final K key,
  		final V value,
  		final long timestamp,
  		final DeweyNumber version)
focal_class.return: Collection<LinkedHashMultimap<K, V>>
focal_class.signature: Collection<LinkedHashMultimap<K, V>> extractPatterns(
  		final K key,
  		final V value,
  		final long timestamp,
  		final DeweyNumber version)
focal_class.class_method_signature: SharedBuffer.lock(final K key, final V value, final long timestamp)
focal_class.full_signature: public void lock(final K key, final V value, final long timestamp)
focal_class.identifier: lock
focal_class.modifiers: public
focal_class.parameters: (final K key, final V value, final long timestamp)
focal_class.return: void
focal_class.signature: void lock(final K key, final V value, final long timestamp)
focal_class.class_method_signature: SharedBuffer.release(final K key, final V value, final long timestamp)
focal_class.full_signature: public void release(final K key, final V value, final long timestamp)
focal_class.identifier: release
focal_class.modifiers: public
focal_class.parameters: (final K key, final V value, final long timestamp)
focal_class.return: void
focal_class.signature: void release(final K key, final V value, final long timestamp)
focal_class.class_method_signature: SharedBuffer.remove(final K key, final V value, final long timestamp)
focal_class.full_signature: public void remove(final K key, final V value, final long timestamp)
focal_class.identifier: remove
focal_class.modifiers: public
focal_class.parameters: (final K key, final V value, final long timestamp)
focal_class.return: void
focal_class.signature: void remove(final K key, final V value, final long timestamp)
focal_class.class_method_signature: SharedBuffer.writeObject(ObjectOutputStream oos)
focal_class.full_signature: private void writeObject(ObjectOutputStream oos)
focal_class.identifier: writeObject
focal_class.modifiers: private
focal_class.parameters: (ObjectOutputStream oos)
focal_class.return: void
focal_class.signature: void writeObject(ObjectOutputStream oos)
focal_class.class_method_signature: SharedBuffer.readObject(ObjectInputStream ois)
focal_class.full_signature: private void readObject(ObjectInputStream ois)
focal_class.identifier: readObject
focal_class.modifiers: private
focal_class.parameters: (ObjectInputStream ois)
focal_class.return: void
focal_class.signature: void readObject(ObjectInputStream ois)
focal_class.class_method_signature: SharedBuffer.get(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.full_signature: private SharedBufferEntry<K, V> get(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.identifier: get
focal_class.modifiers: private
focal_class.parameters: (
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.return: SharedBufferEntry<K, V>
focal_class.signature: SharedBufferEntry<K, V> get(
  		final K key,
  		final V value,
  		final long timestamp)
focal_class.class_method_signature: SharedBuffer.internalRemove(final SharedBufferEntry<K, V> entry)
focal_class.full_signature: private void internalRemove(final SharedBufferEntry<K, V> entry)
focal_class.identifier: internalRemove
focal_class.modifiers: private
focal_class.parameters: (final SharedBufferEntry<K, V> entry)
focal_class.return: void
focal_class.signature: void internalRemove(final SharedBufferEntry<K, V> entry)
focal_class.class_method_signature: SharedBuffer.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: SharedBuffer.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: SharedBuffer.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: public SharedBuffer(final TypeSerializer<V> valueSerializer) {
  		this.valueSerializer = valueSerializer;
  		pages = new HashMap<>();
  	}
focal_method.class_method_signature: SharedBuffer.SharedBuffer(final TypeSerializer<V> valueSerializer)
focal_method.full_signature: public  SharedBuffer(final TypeSerializer<V> valueSerializer)
focal_method.identifier: SharedBuffer
focal_method.modifiers: public
focal_method.parameters: (final TypeSerializer<V> valueSerializer)
focal_method.signature:  SharedBuffer(final TypeSerializer<V> valueSerializer)