org.apache.flink.runtime.state.KeyedStateCheckpointOutputStream Java Examples

The following examples show how to use org.apache.flink.runtime.state.KeyedStateCheckpointOutputStream. 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: Loggers.java    From stateful-functions with Apache License 2.0 5 votes vote down vote up
@Override
public void requireKeyedStateCheckpointed(OutputStream stream) {
  if (stream instanceof KeyedStateCheckpointOutputStream) {
    return;
  }
  throw new IllegalStateException("Not a KeyedStateCheckpointOutputStream");
}
 
Example #2
Source File: Loggers.java    From stateful-functions with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("resource")
public Closeable acquireLease(OutputStream stream) {
  Preconditions.checkState(stream instanceof KeyedStateCheckpointOutputStream);
  try {
    Lease lease = cast(stream).acquireLease();
    return lease::close;
  } catch (IOException e) {
    throw new IllegalStateException("Unable to obtain a lease for the input stream.", e);
  }
}
 
Example #3
Source File: Loggers.java    From flink-statefun with Apache License 2.0 5 votes vote down vote up
@Override
public void requireKeyedStateCheckpointed(OutputStream stream) {
  if (stream instanceof KeyedStateCheckpointOutputStream) {
    return;
  }
  throw new IllegalStateException("Not a KeyedStateCheckpointOutputStream");
}
 
Example #4
Source File: Loggers.java    From flink-statefun with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("resource")
public Closeable acquireLease(OutputStream stream) {
  Preconditions.checkState(stream instanceof KeyedStateCheckpointOutputStream);
  try {
    Lease lease = cast(stream).acquireLease();
    return lease::close;
  } catch (IOException e) {
    throw new IllegalStateException("Unable to obtain a lease for the input stream.", e);
  }
}
 
Example #5
Source File: StateSnapshotContextSynchronousImplTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test
public void testCreateRawKeyedStateOutput() throws Exception {
	KeyedStateCheckpointOutputStream stream = snapshotContext.getRawKeyedOperatorStateOutput();
	Assert.assertNotNull(stream);
}
 
Example #6
Source File: StateSnapshotContextSynchronousImplTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testCreateRawKeyedStateOutput() throws Exception {
	KeyedStateCheckpointOutputStream stream = snapshotContext.getRawKeyedOperatorStateOutput();
	Assert.assertNotNull(stream);
}
 
Example #7
Source File: Loggers.java    From stateful-functions with Apache License 2.0 4 votes vote down vote up
private static KeyedStateCheckpointOutputStream cast(OutputStream stream) {
  Preconditions.checkState(stream instanceof KeyedStateCheckpointOutputStream);
  return (KeyedStateCheckpointOutputStream) stream;
}
 
Example #8
Source File: Loggers.java    From flink-statefun with Apache License 2.0 4 votes vote down vote up
private static KeyedStateCheckpointOutputStream cast(OutputStream stream) {
  Preconditions.checkState(stream instanceof KeyedStateCheckpointOutputStream);
  return (KeyedStateCheckpointOutputStream) stream;
}
 
Example #9
Source File: StateSnapshotContextSynchronousImplTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testCreateRawKeyedStateOutput() throws Exception {
	KeyedStateCheckpointOutputStream stream = snapshotContext.getRawKeyedOperatorStateOutput();
	Assert.assertNotNull(stream);
}