You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by je...@apache.org on 2018/12/02 20:15:18 UTC
[pulsar] branch master updated: add default impl for getKey()
(#3105)
This is an automated email from the ASF dual-hosted git repository.
jerrypeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new c7440f9 add default impl for getKey() (#3105)
c7440f9 is described below
commit c7440f9d48524ec324f6198ce1116880e06b3f38
Author: Boyang Jerry Peng <je...@gmail.com>
AuthorDate: Sun Dec 2 12:15:13 2018 -0800
add default impl for getKey() (#3105)
---
.../src/main/java/org/apache/pulsar/functions/api/Record.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Record.java b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Record.java
index 5840278..cb03cb2 100644
--- a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Record.java
+++ b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Record.java
@@ -37,7 +37,9 @@ public interface Record<T> {
/**
* Return a key if the key has one associated
*/
- Optional<String> getKey();
+ default Optional<String> getKey() {
+ return Optional.empty();
+ }
/**
* Retrieves the actual data of the record