【问题标题】:Hector : java.nio.BufferUnderflowException赫克托:java.nio.BufferUnderflowException
【发布时间】:2013-07-10 01:57:04
【问题描述】:

我正在获取字符串的 ByteBuffer,例如100以下

ByteBuffer data = IntegerSerializer.get().toByteBuffer(Integer.parseInt(data));

并将此数据插入到“MYCOLUMN”列中

在读取我正在使用的“MYCOLUMN”列值时:

public Objct myfunction(ByteBuffer data){
        return IntegerSerializer.get().fromByteBuffer(data);
}

但如果我提到“MYCOLUMN”列,我会收到以下错误

java.nio.BufferUnderflowException
    at java.nio.Buffer.nextGetIndex(Buffer.java:480)
    at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:336)
    at me.prettyprint.cassandra.serializers.IntegerSerializer.fromByteBuffer(IntegerSerializer.java:35)

【问题讨论】:

    标签: java cassandra hector bytebuffer


    【解决方案1】:

    this issue很像:

    您想指定 Int32Type 而不是 IntegerType。后者用词不当,实际上代表一个 BigInteger。

    【讨论】:

      猜你喜欢
      • 2012-07-16
      • 2012-02-23
      • 2012-07-19
      • 1970-01-01
      • 2012-07-03
      • 2013-03-17
      • 2011-07-03
      • 2012-06-10
      • 2012-07-16
      相关资源
      最近更新 更多