Checkpoint extends InternalDatabusEventsListenerAbstract implements Serializable, Cloneable { public void serialize(OutputStream outStream) throws JsonGenerationException, JsonMappingException, IOException { internalStateToMap(); mapper.writeValue(outStream, internalData); } @SuppressWarnings("unchecked")  Checkpoint(String serializedCheckpoint);  Checkpoint(); void init(); void setTsNsecs(long nsecs); long getTsNsecs(); void setBootstrapStartNsecs(long nsecs); long getBootstrapStartNsecs(); void setBootstrapSnapshotSourceIndex(int index); void setBootstrapCatchupSourceIndex(int index); void setBootstrapServerInfo(String serverInfoStr); String getBootstrapServerInfo(); void setWindowScn(Long windowScn); void setPrevScn(Long windowScn); long getPrevScn(); void setWindowOffset(long windowOffset); @Deprecated /** @deprecated Please use {@link #setWindowOffset(long)} */ void setWindowOffset(Integer windowOffset); void setConsumptionMode(DbusClientMode mode); void setBootstrapStartScn(Long bootstrapStartScn); void setSnapshotSource(int sourceIndex, String sourceName); void setSnapshotOffset(long snapshotOffset); @Deprecated /** @deprecated Please use #setSnapshotOffset(long) */ void setSnapshotOffset(Integer snapshotOffset); void setCatchupOffset(Integer catchupOffset); void setBootstrapTargetScn(Long targetScn); void setBootstrapSinceScn(Long sinceScn); long getWindowScn(); Long getWindowOffset(); DbusClientMode getConsumptionMode(); String getSnapshotSource(); long getSnapshotFileRecordOffset(); void setSnapshotFileRecordOffset(long snapshotFileRecordOffset); String getStorageClusterName(); void setStorageClusterName(String storageClusterName); Long getSnapshotOffset(); String getCatchupSource(); Long getBootstrapStartScn(); Long getBootstrapTargetScn(); Integer getBootstrapSnapshotSourceIndex(); Integer getBootstrapCatchupSourceIndex(); Long getBootstrapSinceScn(); void serialize(OutputStream outStream); @Override String toString(); void startEvent(); @Override void onEvent(DbusEvent e, long offset, int size); void onEvent(DbusEvent e); void onSnapshotEvent(long snapshotOffset); void onCatchupEvent(long eventWindowScn, long catchupOffset); void startSnapShotSource(); void endSnapShotSource(); boolean isSnapShotSourceCompleted(); void startCatchupSource(); void endCatchupSource(); boolean isCatchupSourceCompleted(); void bootstrapCheckPoint(); void checkPoint(); boolean isPartialWindow(); @Deprecated void setInit(); boolean getInit(); void setFlexible(); boolean getFlexible(); void clearBootstrapStartTsNsecs(); void clearBootstrapSinceScn(); void clearBootstrapStartScn(); void clearBootstrapTargetScn(); boolean isBootstrapStartScnSet(); boolean isBootstrapTargetScnSet(); boolean isBootstrapSinceScnSet(); void resetBootstrap(); @Override void close(); @Override Checkpoint clone(); static Checkpoint createFlexibleCheckpoint(); static Checkpoint createOnlineConsumptionCheckpoint(long lastConsumedScn); static Checkpoint createOnlineConsumptionCheckpoint(long lastConsumedScn, long tsNanos); @Override boolean equals(Object other); @Override int hashCode(); boolean assertCheckpoint(); static final String MODULE; static final Logger LOG; static final long UNSET_BOOTSTRAP_START_NSECS; static final long UNSET_TS_NSECS; static final long UNSET_BOOTSTRAP_START_SCN; static final long UNSET_BOOTSTRAP_SINCE_SCN; static final long UNSET_BOOTSTRAP_TARGET_SCN; static final int UNSET_BOOTSTRAP_INDEX; static final long UNSET_ONLINE_PREVSCN; static final long WINDOW_SCN_FOR_PURE_TIMEBASED_CKPT; static final String NO_SOURCE_NAME; static final Long FULLY_CONSUMED_WINDOW_OFFSET; static final Long DEFAULT_SNAPSHOT_FILE_RECORD_OFFSET; static final String BOOTSTRAP_SERVER_INFO; static final String SNAPSHOT_FILE_RECORD_OFFSET; static final String STORAGE_CLUSTER_NAME; static final String BOOTSTRAP_START_TSNSECS; }
@Test public void testSerialize() throws JsonParseException, JsonMappingException, IOException { Checkpoint cp = Checkpoint.createOnlineConsumptionCheckpoint(1234L); cp.setWindowOffset(5677); cp.setPrevScn(1233L); ByteArrayOutputStream baos = new ByteArrayOutputStream(); cp.serialize(baos); Checkpoint newCp = new Checkpoint(baos.toString()); Assert.assertTrue(newCp.assertCheckpoint()); assertEquals(cp, newCp); Assert.assertEquals(cp.hashCode(), newCp.hashCode()); }