spark git commit: [SPARK-23317][SQL] rename ContinuousReader.setOffset to setStartOffset

2018-02-02 Thread lixiao
Repository: spark
Updated Branches:
  refs/heads/master 3ff83ad43 -> fe73cb4b4


[SPARK-23317][SQL] rename ContinuousReader.setOffset to setStartOffset

## What changes were proposed in this pull request?

In the document of `ContinuousReader.setOffset`, we say this method is used to 
specify the start offset. We also have a `ContinuousReader.getStartOffset` to 
get the value back. I think it makes more sense to rename 
`ContinuousReader.setOffset` to `setStartOffset`.

## How was this patch tested?

N/A

Author: Wenchen Fan 

Closes #20486 from cloud-fan/rename.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fe73cb4b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fe73cb4b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fe73cb4b

Branch: refs/heads/master
Commit: fe73cb4b439169f16cc24cd851a11fd398ce7edf
Parents: 3ff83ad
Author: Wenchen Fan 
Authored: Fri Feb 2 20:49:08 2018 -0800
Committer: gatorsmile 
Committed: Fri Feb 2 20:49:08 2018 -0800

--
 .../org/apache/spark/sql/kafka010/KafkaContinuousReader.scala| 2 +-
 .../spark/sql/sources/v2/reader/streaming/ContinuousReader.java  | 4 ++--
 .../sql/execution/streaming/continuous/ContinuousExecution.scala | 2 +-
 .../streaming/continuous/ContinuousRateStreamSource.scala| 2 +-
 .../apache/spark/sql/execution/streaming/RateSourceV2Suite.scala | 2 +-
 .../spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/fe73cb4b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
--
diff --git 
a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
 
b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
index 41c443b..b049a05 100644
--- 
a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
+++ 
b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
@@ -71,7 +71,7 @@ class KafkaContinuousReader(
   override def readSchema: StructType = KafkaOffsetReader.kafkaSchema
 
   private var offset: Offset = _
-  override def setOffset(start: ju.Optional[Offset]): Unit = {
+  override def setStartOffset(start: ju.Optional[Offset]): Unit = {
 offset = start.orElse {
   val offsets = initialOffsets match {
 case EarliestOffsetRangeLimit => 
KafkaSourceOffset(offsetReader.fetchEarliestOffsets())

http://git-wip-us.apache.org/repos/asf/spark/blob/fe73cb4b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
--
diff --git 
a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
 
b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
index d1d1e7f..7fe7f00 100644
--- 
a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
+++ 
b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
@@ -51,12 +51,12 @@ public interface ContinuousReader extends 
BaseStreamingSource, DataSourceReader
  * start from the first record after the provided offset, or from an 
implementation-defined
  * inferred starting point if no offset is provided.
  */
-void setOffset(Optional start);
+void setStartOffset(Optional start);
 
 /**
  * Return the specified or inferred start offset for this reader.
  *
- * @throws IllegalStateException if setOffset has not been called
+ * @throws IllegalStateException if setStartOffset has not been called
  */
 Offset getStartOffset();
 

http://git-wip-us.apache.org/repos/asf/spark/blob/fe73cb4b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
--
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
index 08c8141..ed22b91 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
+++ 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
@@ -181,7 +181,7 @@ class ContinuousExecution(
 
 val loggedOffset = offsets.offsets(0)
 val realOffset = 

spark git commit: [SPARK-23317][SQL] rename ContinuousReader.setOffset to setStartOffset

2018-02-02 Thread lixiao
Repository: spark
Updated Branches:
  refs/heads/branch-2.3 dcd0af4be -> b614c083a


[SPARK-23317][SQL] rename ContinuousReader.setOffset to setStartOffset

## What changes were proposed in this pull request?

In the document of `ContinuousReader.setOffset`, we say this method is used to 
specify the start offset. We also have a `ContinuousReader.getStartOffset` to 
get the value back. I think it makes more sense to rename 
`ContinuousReader.setOffset` to `setStartOffset`.

## How was this patch tested?

N/A

Author: Wenchen Fan 

Closes #20486 from cloud-fan/rename.

(cherry picked from commit fe73cb4b439169f16cc24cd851a11fd398ce7edf)
Signed-off-by: gatorsmile 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b614c083
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b614c083
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b614c083

Branch: refs/heads/branch-2.3
Commit: b614c083a4875c874180a93b08ea5031fa90cfec
Parents: dcd0af4
Author: Wenchen Fan 
Authored: Fri Feb 2 20:49:08 2018 -0800
Committer: gatorsmile 
Committed: Fri Feb 2 20:49:17 2018 -0800

--
 .../org/apache/spark/sql/kafka010/KafkaContinuousReader.scala| 2 +-
 .../spark/sql/sources/v2/reader/streaming/ContinuousReader.java  | 4 ++--
 .../sql/execution/streaming/continuous/ContinuousExecution.scala | 2 +-
 .../streaming/continuous/ContinuousRateStreamSource.scala| 2 +-
 .../apache/spark/sql/execution/streaming/RateSourceV2Suite.scala | 2 +-
 .../spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/b614c083/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
--
diff --git 
a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
 
b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
index 41c443b..b049a05 100644
--- 
a/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
+++ 
b/external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaContinuousReader.scala
@@ -71,7 +71,7 @@ class KafkaContinuousReader(
   override def readSchema: StructType = KafkaOffsetReader.kafkaSchema
 
   private var offset: Offset = _
-  override def setOffset(start: ju.Optional[Offset]): Unit = {
+  override def setStartOffset(start: ju.Optional[Offset]): Unit = {
 offset = start.orElse {
   val offsets = initialOffsets match {
 case EarliestOffsetRangeLimit => 
KafkaSourceOffset(offsetReader.fetchEarliestOffsets())

http://git-wip-us.apache.org/repos/asf/spark/blob/b614c083/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
--
diff --git 
a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
 
b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
index d1d1e7f..7fe7f00 100644
--- 
a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
+++ 
b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/streaming/ContinuousReader.java
@@ -51,12 +51,12 @@ public interface ContinuousReader extends 
BaseStreamingSource, DataSourceReader
  * start from the first record after the provided offset, or from an 
implementation-defined
  * inferred starting point if no offset is provided.
  */
-void setOffset(Optional start);
+void setStartOffset(Optional start);
 
 /**
  * Return the specified or inferred start offset for this reader.
  *
- * @throws IllegalStateException if setOffset has not been called
+ * @throws IllegalStateException if setStartOffset has not been called
  */
 Offset getStartOffset();
 

http://git-wip-us.apache.org/repos/asf/spark/blob/b614c083/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
--
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
index 08c8141..ed22b91 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
+++