Skip to content

Commit

Permalink
[CdapIO] HasOffset interface was implemented (#22193)
Browse files Browse the repository at this point in the history
* [BEAM-22148] HasOffset interface was implemented

* [BEAM-22148] Formatting was fixed
  • Loading branch information
sorokin-andrey authored Jul 21, 2022
1 parent 9697c13 commit caaefc0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdks/java/io/sparkreceiver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ dependencies {
compileOnly "org.scala-lang:scala-library:2.11.12"
testImplementation project(path: ":sdks:java:io:cdap", configuration: "testRuntimeMigration")
testImplementation library.java.junit
testImplementation project(path: ":runners:direct-java", configuration: "shadow")
testImplementation project(path: ":examples:java", configuration: "testRuntimeMigration")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.beam.sdk.io.sparkreceiver;

/**
* Interface for any Spark {@link org.apache.spark.streaming.receiver.Receiver} that supports
* reading from and to some offset.
*/
public interface HasOffset {

/** @param offset inclusive start offset from which the reading should be started. */
void setStartOffset(Long offset);

/** @return exclusive end offset to which the reading from current page will occur. */
Long getEndOffset();
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ include(":sdks:java:io:pulsar")
include(":sdks:java:io:rabbitmq")
include(":sdks:java:io:redis")
include(":sdks:java:io:solr")
include(":sdks:java:io:sparkreceiver")
include(":sdks:java:io:snowflake")
include(":sdks:java:io:snowflake:expansion-service")
include(":sdks:java:io:splunk")
Expand Down

0 comments on commit caaefc0

Please sign in to comment.