Giter Site home page Giter Site logo

Comments (4)

 avatar commented on June 9, 2024

Hi Shay,

ByteIterator.toArray() and ByteIterator.toString().getBytes() should return the same byte array. Could you try something like this and see what ByteIterator.toArray() is returning?

  private Map<String, byte[]> convertToBytearrayMap(Map<String,ByteIterator> values) {
    Map<String, byte[]> retVal = new HashMap<String, byte[]>();
    for (String key : values.keySet()) {
      System.out.println("key: " + key + ", bytesLeft: " + values.get(key).bytesLeft());
      byte[] value = values.get(key).toArray();
      System.out.println("value size: " + value.length);
      System.out.println("key: " + key + ", bytesLeft: " + values.get(key).bytesLeft());
      retVal.put(key, value);
    }
    return retVal;             
  }     

Thanks!
--Michi

from ycsb.

westonplatter avatar westonplatter commented on June 9, 2024

@ShayHassidim - also something that may impact gemfire is that we recently merged a gemfire change that fixed a bug, #123. It might be worth pulling a fresh copy of the codebase.

from ycsb.

busbey avatar busbey commented on June 9, 2024

I think this issue comes down to incorrect handling of String <-> byte[]. In addition to #279, StringByteIterator incorrectly uses the String's character length to determine how many bytes should be made and then incorrectly pulls each character and truncates it to a byte.

That means for Strings made up of non-ascii, toArray() will return a smaller array than if you immediately call toString().getBytes() (if you don't call toString immediately then you get the wrong answer still).

from ycsb.

busbey avatar busbey commented on June 9, 2024

Fixed by #288

from ycsb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.