You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "kennknowles (via GitHub)" <gi...@apache.org> on 2023/04/26 17:49:00 UTC

[GitHub] [beam] kennknowles commented on a diff in pull request #26422: Eliminate nullness and rawtype errors from java SDK Read class

kennknowles commented on code in PR #26422:
URL: https://github.com/apache/beam/pull/26422#discussion_r1178212952


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/Read.java:
##########
@@ -839,16 +850,16 @@ public CheckpointMark getCheckpointMark() {
       }
 
       private Object createCacheKey(
-          UnboundedSource<OutputT, CheckpointT> source, CheckpointT checkpoint) {
-        checkNotNull(restrictionCoder);
+          UnboundedSource<OutputT, CheckpointT> source, @Nullable CheckpointT checkpoint) {
+        checkStateNotNull(restrictionCoder);
         // For caching reader, we don't care about the watermark.
         return restrictionCoder.structuralValue(
             UnboundedSourceRestriction.create(
                 source, checkpoint, BoundedWindow.TIMESTAMP_MIN_VALUE));
       }
 
       private void initializeCurrentReader() throws IOException {
-        Preconditions.checkState(currentReader == null);
+        checkStateNotNull(currentReader);

Review Comment:
   oops



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org