Kafka, mail # user - Re: PartitionOffsetRequestInfo only supports -1 and -2? - 2014-01-08, 01:45
 Search Hadoop and all its subprojects:

Switch to Threaded View
Copy link to this message
-
Re: PartitionOffsetRequestInfo only supports -1 and -2?
Jun,
    Regarding the arbitrary timestamp, I found that if I use the
GetOffsetShell<https://github.com/apache/kafka/blob/0.8/core/src/main/scala/kafka/tools/GetOffsetShell.scala>,
it works. But if I use the Java API ( requestInfo.put(topicAndPartition, new
 PartitionOffsetRequestInfo(SOME_LONG_TIMESTAMP, 1));), it only returns an
empty long[].

    I looked at the source of GetOffsetShell, the way the offset is
retrieved is slightly different from using the java api. Could that be a
bug?
Scala API:
val offsets = consumer.getOffsetsBefore(request).partitionErrorAndOffsets(
topicAndPartition).offsets

Java API:
consumer.getOffsetsBefore(request).offsets(topic, partition);
thanks,
Cal

On Tue, Jan 7, 2014 at 6:49 PM, Jun Rao <[EMAIL PROTECTED]> wrote:
 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB