[ 
https://issues.apache.org/jira/browse/MNEMONIC-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17462071#comment-17462071
 ] 

Wang, Gang edited comment on MNEMONIC-704 at 12/19/21, 4:55 AM:
----------------------------------------------------------------

Regarding the conversion from `ByteBuffer` to type 'byte[]`,  the pseudo code 
could be
{code:java}
if (b.hasArray()) {
jedis.hset("key name", "field name", buf.array());
} else {
byte[] arr = new byte[buf.remaining()];
buf.get(arr);
 jedis.hset("key name", "field name", arr);
}
 
{code}
 


was (Author: qichfan):
Regarding the conversion from `ByteBuffer` to type 'byte[]`,  the pseudo code 
could be
if 
(b.[hasArray|https://www.tabnine.com/code/java/methods/java.nio.ByteBuffer/hasArray]())
 {
  jedis.hset("key name", "field name", 
buf.[array|https://www.tabnine.com/code/java/methods/java.nio.ByteBuffer/array]());
} else {
  byte[] arr = new byte[buf.remaining()];
  buf.get(arr);
  jedis.hset("key name", "field name", arr);
}


 

> Define redis integration interface with mnemonic backend
> --------------------------------------------------------
>
>                 Key: MNEMONIC-704
>                 URL: https://issues.apache.org/jira/browse/MNEMONIC-704
>             Project: Mnemonic
>          Issue Type: Sub-task
>          Components: Computing-Service
>    Affects Versions: 0.17.0
>            Reporter: Yanhui Zhao
>            Assignee: Yanhui Zhao
>            Priority: Major
>             Fix For: 0.17.0
>
>
> In order to connect to redis as a backend storage, mnemonic side need to 
> expose interface that can be integrated with redis for storage access.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to