Skip to content

Commit

Permalink
feat: change overloaded private method name (#48)
Browse files Browse the repository at this point in the history
I am attempting to pull the sdk in another gradle package and the compile fails looking for ByteString 

```
/Users/gautamkanvinde/repos/client-sdk-examples/java-gradle/lib/src/main/java/momento/client/example/Library.java:11: error: cannot access ByteString
    CacheSetResponse resp = client.set("key", "value", 1000);
                                  ^
  class file for com.google.protobuf.ByteString not found
1 error
```

I have a theory that this is due to the overloaded methods and wanted to test this out quick.
  • Loading branch information
gautamomento authored Sep 30, 2021
1 parent b014316 commit e7fbff7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions momento-sdk/src/main/java/momento/sdk/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ public CacheGetResponse get(String key) {
* @throws IOException if an error occurs opening ByteBuffer for request body.
*/
public CacheSetResponse set(String key, ByteBuffer value, int ttlSeconds) {
return set(convert(key), convert(value), ttlSeconds);
return sendSet(convert(key), convert(value), ttlSeconds);
}

public CacheSetResponse set(String key, String value, int ttlSeconds) {
return set(convert(key), convert(value), ttlSeconds);
return sendSet(convert(key), convert(value), ttlSeconds);
}

public CacheSetResponse set(byte[] key, byte[] value, int ttlSeconds) {
return set(convert(key), convert(value), ttlSeconds);
return sendSet(convert(key), convert(value), ttlSeconds);
}

private CacheSetResponse set(ByteString key, ByteString value, int ttlSeconds) {
private CacheSetResponse sendSet(ByteString key, ByteString value, int ttlSeconds) {
Optional<Span> span = buildSpan("java-sdk-set-request");
try (Scope ignored = (span.map(ImplicitContextKeyed::makeCurrent).orElse(null))) {
SetResponse rsp = blockingStub.set(buildSetRequest(key, value, ttlSeconds * 1000));
Expand Down

0 comments on commit e7fbff7

Please sign in to comment.