How to convert an integer into ByteIterator in Java for MongoDB

270 Views Asked by At

I am using YCSB for benchmarking. I am writing a custom code in Java. I have two fields which are of String and Int type but the db.insert method takes a HashMap of <String,ByteIterator> type. How can I convert String and integer into ByteIterator type? Please help

1

There are 1 best solutions below

0
On

You can use

new com.yahoo.ycsb.StringByteIterator(string);

I suggest you look at the MongoDbClient to see how it is supported already.