jiangpengcheng commented on code in PR #21966:
URL: https://github.com/apache/pulsar/pull/21966#discussion_r1466178046


##########
tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarStateTest.java:
##########
@@ -480,6 +480,7 @@ private void queryState(String functionName, String key, 
int amount)
             "--key", key
         );
         assertTrue(result.getStdout().contains("\"numberValue\": " + amount));
+        assertTrue(result.getStdout().contains("\"version\": " + version));

Review Comment:
   added below:
   
   ```
           assertFalse(result.getStdout().contains("stringValue"));
           assertFalse(result.getStdout().contains("byteValue"));
   ```



##########
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/state/PulsarMetadataStateStoreImpl.java:
##########
@@ -111,6 +112,20 @@ public CompletableFuture<ByteBuffer> getAsync(String key) {
                                 .orElse(null));
     }
 
+    @Override
+    public StateValue getStateValue(String key) {
+        return getStateValueAsync(key).join();
+    }
+
+    @Override
+    public CompletableFuture<StateValue> getStateValueAsync(String key) {
+        return store.get(getPath(key))
+                .thenApply(optRes ->
+                        optRes.map(x ->
+                            new StateValue(ByteBuffer.wrap(x.getValue()), 
x.getStat().getVersion(), null))

Review Comment:
   Great, I will use `byte[]` 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to