You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Ted Yu <yu...@gmail.com> on 2018/05/31 16:02:57 UTC

referencing OffsetCheckpoint in downstream project

Hi,
OffsetCheckpoint has been relocated
to org.apache.kafka.streams.state.internals package.

Does this mean that downstream project should no longer reference this
class ?

This is how the class is used (against Kafka 0.10.0.1 release) :

    // ensure that topic is removed from all cleaner offsets
    assert(servers.forall(server => topicAndPartitions.forall { tp =>
      val checkpoints = server.getLogManager().logDirs.map { logDir =>
        new OffsetCheckpoint(new File(logDir,
"cleaner-offset-checkpoint")).read()
      }
      checkpoints.forall(checkpointsPerLogDir =>
!checkpointsPerLogDir.contains(tp))
    }), s"checkpoint for topic $topic still exists")

Cheers

Re: referencing OffsetCheckpoint in downstream project

Posted by Ted Yu <yu...@gmail.com>.
Thanks for the reply.

It seems the following class in newer release can do what the test needs:

class OffsetCheckpointFile(val file: File, logDirFailureChannel:
LogDirFailureChannel = null) {

Cheers

On Thu, May 31, 2018 at 9:27 AM, Ismael Juma <is...@gmail.com> wrote:

> Hi Ted,
>
> There are two such classes. The example you have is for the broker class,
> not the Streams one.
>
> Ismael
>
> On Thu, 31 May 2018, 09:03 Ted Yu, <yu...@gmail.com> wrote:
>
> > Hi,
> > OffsetCheckpoint has been relocated
> > to org.apache.kafka.streams.state.internals package.
> >
> > Does this mean that downstream project should no longer reference this
> > class ?
> >
> > This is how the class is used (against Kafka 0.10.0.1 release) :
> >
> >     // ensure that topic is removed from all cleaner offsets
> >     assert(servers.forall(server => topicAndPartitions.forall { tp =>
> >       val checkpoints = server.getLogManager().logDirs.map { logDir =>
> >         new OffsetCheckpoint(new File(logDir,
> > "cleaner-offset-checkpoint")).read()
> >       }
> >       checkpoints.forall(checkpointsPerLogDir =>
> > !checkpointsPerLogDir.contains(tp))
> >     }), s"checkpoint for topic $topic still exists")
> >
> > Cheers
> >
>

Re: referencing OffsetCheckpoint in downstream project

Posted by Ismael Juma <is...@gmail.com>.
Hi Ted,

There are two such classes. The example you have is for the broker class,
not the Streams one.

Ismael

On Thu, 31 May 2018, 09:03 Ted Yu, <yu...@gmail.com> wrote:

> Hi,
> OffsetCheckpoint has been relocated
> to org.apache.kafka.streams.state.internals package.
>
> Does this mean that downstream project should no longer reference this
> class ?
>
> This is how the class is used (against Kafka 0.10.0.1 release) :
>
>     // ensure that topic is removed from all cleaner offsets
>     assert(servers.forall(server => topicAndPartitions.forall { tp =>
>       val checkpoints = server.getLogManager().logDirs.map { logDir =>
>         new OffsetCheckpoint(new File(logDir,
> "cleaner-offset-checkpoint")).read()
>       }
>       checkpoints.forall(checkpointsPerLogDir =>
> !checkpointsPerLogDir.contains(tp))
>     }), s"checkpoint for topic $topic still exists")
>
> Cheers
>